Changed how contrib.extended_room's details are reset.
This commit is contained in:
parent
178fe9f28c
commit
ca4feb4d21
1 changed files with 13 additions and 6 deletions
|
|
@ -300,6 +300,11 @@ class CmdExtendedDesc(default_cmds.CmdDesc):
|
||||||
"""
|
"""
|
||||||
aliases = ["@describe", "@detail"]
|
aliases = ["@describe", "@detail"]
|
||||||
|
|
||||||
|
def reset_times(self, obj):
|
||||||
|
"By deleteting the caches we force a re-load."
|
||||||
|
del obj.ndb.last_season
|
||||||
|
del ndb.last_timeslot
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
"Define extended command"
|
"Define extended command"
|
||||||
caller = self.caller
|
caller = self.caller
|
||||||
|
|
@ -327,10 +332,12 @@ class CmdExtendedDesc(default_cmds.CmdDesc):
|
||||||
if self.lhs in location.db.details:
|
if self.lhs in location.db.details:
|
||||||
del location.db.detail
|
del location.db.detail
|
||||||
caller.msg("Detail %s deleted, if it existed." % self.lhs)
|
caller.msg("Detail %s deleted, if it existed." % self.lhs)
|
||||||
|
self.reset(location)
|
||||||
return
|
return
|
||||||
# setting a detail
|
# setting a detail
|
||||||
location.db.details[self.lhs] = self.rhs
|
location.db.details[self.lhs] = self.rhs
|
||||||
caller.msg("Set Detail %s to '%s'." % (self.lhs, self.rhs))
|
caller.msg("Set Detail %s to '%s'." % (self.lhs, self.rhs))
|
||||||
|
self.reset(location)
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
# we are doing a @desc call
|
# we are doing a @desc call
|
||||||
|
|
@ -358,20 +365,20 @@ class CmdExtendedDesc(default_cmds.CmdDesc):
|
||||||
elif switch == 'autumn': location.db.autumn_desc = self.args
|
elif switch == 'autumn': location.db.autumn_desc = self.args
|
||||||
elif switch == 'winter': location.db.winter_desc = self.args
|
elif switch == 'winter': location.db.winter_desc = self.args
|
||||||
# clear flag to force an update
|
# clear flag to force an update
|
||||||
location.ndb.last_season = None
|
self.reset(location)
|
||||||
caller.msg("Seasonal description was set on %s." % location.key)
|
caller.msg("Seasonal description was set on %s." % location.key)
|
||||||
elif self.rhs:
|
elif self.rhs:
|
||||||
# Not a seasonal desc, and we have an =
|
# Not a seasonal desc, and we have an =. Assumed not extendedroom.
|
||||||
obj = caller.search(self.lhs)
|
obj = caller.search(self.lhs)
|
||||||
if not obj:
|
if not obj:
|
||||||
return
|
return
|
||||||
obj.db.desc = self.rhs
|
obj.db.desc = self.rhs
|
||||||
caller.msg("The description was set on %s." % obj.key)
|
caller.msg("The description was set on %s." % obj.key)
|
||||||
else:
|
else:
|
||||||
# set a normal non-seasonal description (fallback) on room
|
# set a normal non-seasonal description (fallback) on extended room
|
||||||
obj = caller.location
|
location.db.general_desc = self.args
|
||||||
obj.db.general_desc = self.args
|
location.db.desc = self.args # compatability
|
||||||
obj.db.desc = self.args # compatability
|
self.reset(obj)
|
||||||
caller.msg("General description was set on %s." % obj.key)
|
caller.msg("General description was set on %s." % obj.key)
|
||||||
|
|
||||||
# Simple command to view the current time and season
|
# Simple command to view the current time and season
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue