Fixed an issue with quell not correctly updating its caches in some situations.

This commit is contained in:
Griatch 2013-11-11 21:51:41 +01:00
parent ead595c2df
commit ebdc6cdbd4
3 changed files with 6 additions and 12 deletions

View file

@ -43,7 +43,7 @@ The Extended Room can be "detailed" with special keywords. This makes
use of a special Look command. Details are "virtual" targets to look
at, without there having to be a database object created for it. The
Details are simply stored in a dictionary on the room and if the look
command cannot find an object match for a a "look <target>" command it
command cannot find an object match for a "look <target>" command it
will also look through the available details at the current location
if applicable. An extended @desc command is used to set details.
@ -119,7 +119,7 @@ class ExtendedRoom(Room):
def get_time_and_season(self):
"""
Calcualte the current time and season ids
Calculate the current time and season ids
"""
# get the current time as parts of year and parts of day
time = gametime.gametime(format=True) # returns a tuple (years,months,weeks,days,hours,minutes,sec)

View file

@ -616,6 +616,7 @@ class CmdQuell(MuxPlayerCommand):
# we are already puppeting an object. We need to reset the lock caches
# (otherwise the superuser status change won't be visible until repuppet)
char.locks.reset()
player.locks.reset()
def func(self):
"Perform the command"

View file

@ -168,9 +168,7 @@ class LockHandler(object):
self.obj = obj
self.locks = {}
self.log_obj = None
self.reset_flag = False
self._cache_locks(self.obj.lock_storage)
self.cache_lock_bypass(obj)
self.reset()
def __str__(self):
return ";".join(self.locks[key][2] for key in sorted(self.locks))
@ -332,7 +330,8 @@ class LockHandler(object):
Set the reset flag, so the the lock will be re-cached at next checking.
This is usually set by @reload.
"""
self.reset_flag = True
self._cache_locks(self.obj.lock_storage)
self.cache_lock_bypass(self.obj)
def check(self, accessing_obj, access_type, default=False, no_superuser_bypass=False):
"""
@ -362,12 +361,6 @@ class LockHandler(object):
functions (as defined by your settings) are executed.
"""
if self.reset_flag:
# rebuild cache, either directly or next call
self._cache_locks(self.obj.lock_storage)
self.reset_flag = False
self.cache_lock_bypass(self.obj)
try:
# check if the lock should be bypassed (e.g. superuser status)
if accessing_obj.locks.lock_bypass and not no_superuser_bypass: