From 99c4042fbc8be7ca1dd0ff1ad25fecf7126c9074 Mon Sep 17 00:00:00 2001 From: Griatch Date: Wed, 11 Jan 2017 21:49:23 +0100 Subject: [PATCH] Make the lock command force-update Exits to handle cmd-type locks without a reload; as per #1142. --- evennia/commands/default/building.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/evennia/commands/default/building.py b/evennia/commands/default/building.py index 1db12a6ee2..019674ecf9 100644 --- a/evennia/commands/default/building.py +++ b/evennia/commands/default/building.py @@ -1820,6 +1820,11 @@ class CmdLock(ObjManipCommand): ok = obj.locks.add(lockdef) except LockException as 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: caller.msg("Added lock '%s' to %s." % (lockdef, obj)) return @@ -1915,7 +1920,7 @@ class CmdExamine(ObjManipCommand): string += "\n|wSession id(s)|n: %s" % (", ".join("#%i" % sess.sessid for sess in obj.sessions.all())) if hasattr(obj, "email") and obj.email: - string += "\n|wEmail|n: |c%s|n" % obj.email + string += "\n|wEmail|n: |c%s|n" % obj.email if hasattr(obj, "has_player") and obj.has_player: string += "\n|wPlayer|n: |c%s|n" % obj.player.name perms = obj.player.permissions.all()