From ba7a6bc6f4761786491cf439df915abd556642ff Mon Sep 17 00:00:00 2001 From: bonnedav Date: Mon, 29 Jun 2020 21:59:18 -0600 Subject: [PATCH] Make CmdOpen grant control to creator Fixes #2152 Not tested but based on existing code in CmdCreate so I imagine it will work. --- evennia/commands/default/building.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/evennia/commands/default/building.py b/evennia/commands/default/building.py index ace7b7a7b7..65016bb23d 100644 --- a/evennia/commands/default/building.py +++ b/evennia/commands/default/building.py @@ -1407,6 +1407,7 @@ class CmdOpen(ObjManipCommand): locks = "cmd:perm(open) or perm(Builder)" help_category = "Building" + new_obj_lockstring = "control:id({id}) or perm(Admin);delete:id({id}) or perm(Admin)" # a custom member method to chug out exits and do checks def create_exit(self, exit_name, location, destination, exit_aliases=None, typeclass=None): """ @@ -1452,10 +1453,11 @@ class CmdOpen(ObjManipCommand): else: # exit does not exist before. Create a new one. + lockstring = self.new_obj_lockstring.format(id=caller.id) if not typeclass: typeclass = settings.BASE_EXIT_TYPECLASS exit_obj = create.create_object( - typeclass, key=exit_name, location=location, aliases=exit_aliases, report_to=caller + typeclass, key=exit_name, location=location, aliases=exit_aliases, locks=lockstring, report_to=caller ) if exit_obj: # storing a destination is what makes it an exit!