mirror of
https://github.com/evennia/evennia.git
synced 2026-03-31 04:57:16 +02:00
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"]
|
||||
|
||||
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):
|
||||
"Define extended command"
|
||||
caller = self.caller
|
||||
|
|
@ -327,10 +332,12 @@ class CmdExtendedDesc(default_cmds.CmdDesc):
|
|||
if self.lhs in location.db.details:
|
||||
del location.db.detail
|
||||
caller.msg("Detail %s deleted, if it existed." % self.lhs)
|
||||
self.reset(location)
|
||||
return
|
||||
# setting a detail
|
||||
location.db.details[self.lhs] = self.rhs
|
||||
caller.msg("Set Detail %s to '%s'." % (self.lhs, self.rhs))
|
||||
self.reset(location)
|
||||
return
|
||||
else:
|
||||
# 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 == 'winter': location.db.winter_desc = self.args
|
||||
# clear flag to force an update
|
||||
location.ndb.last_season = None
|
||||
self.reset(location)
|
||||
caller.msg("Seasonal description was set on %s." % location.key)
|
||||
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)
|
||||
if not obj:
|
||||
return
|
||||
obj.db.desc = self.rhs
|
||||
caller.msg("The description was set on %s." % obj.key)
|
||||
else:
|
||||
# set a normal non-seasonal description (fallback) on room
|
||||
obj = caller.location
|
||||
obj.db.general_desc = self.args
|
||||
obj.db.desc = self.args # compatability
|
||||
# set a normal non-seasonal description (fallback) on extended room
|
||||
location.db.general_desc = self.args
|
||||
location.db.desc = self.args # compatability
|
||||
self.reset(obj)
|
||||
caller.msg("General description was set on %s." % obj.key)
|
||||
|
||||
# Simple command to view the current time and season
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue