Fix bug, set no-idle locks on bots

This commit is contained in:
Griatch 2017-08-20 23:36:36 +02:00
parent 72e3498785
commit ea87eef218
3 changed files with 14 additions and 15 deletions

View file

@ -1779,12 +1779,13 @@ class CmdLock(ObjManipCommand):
if '/' in self.lhs:
# call on the form @lock obj/access_type
objname, access_type = [p.strip() for p in self.lhs.split('/', 1)]
obj = None
if objname.startswith("*"):
obj = caller.search_account(objname.lstrip('*'))
if not obj:
obj = caller.search(objname)
if not obj:
obj = caller.search(objname)
if not obj:
return
return
if not (obj.access(caller, 'control') or obj.access(caller, "edit")):
caller.msg("You are not allowed to do that.")
return
@ -1811,12 +1812,13 @@ class CmdLock(ObjManipCommand):
return
objname, lockdef = self.lhs, self.rhs
obj = None
if objname.startswith("*"):
obj = caller.search_account(objname.lstrip('*'))
if not obj:
obj = caller.search(objname)
if not obj:
obj = caller.search(objname)
if not obj:
return
return
if not (obj.access(caller, 'control') or obj.access(caller, "edit")):
caller.msg("You are not allowed to do that.")
return