Make the lock command force-update Exits to handle cmd-type locks without a reload; as per #1142.

This commit is contained in:
Griatch 2017-01-11 21:49:23 +01:00
parent b57b807da6
commit 99c4042fbc

View file

@ -1820,6 +1820,11 @@ class CmdLock(ObjManipCommand):
ok = obj.locks.add(lockdef) ok = obj.locks.add(lockdef)
except LockException as e: except LockException as e:
caller.msg(str(e)) caller.msg(str(e))
if "cmd" in lockdef.lower() and \
inherits_from(obj, "evennia.objects.objects.DefaultExit"):
# special fix to update Exits since "cmd"-type locks won't
# update on them unless their cmdsets are rebuilt.
obj.at_init()
if ok: if ok:
caller.msg("Added lock '%s' to %s." % (lockdef, obj)) caller.msg("Added lock '%s' to %s." % (lockdef, obj))
return return