Let caller.search_account query all Account classes. Resolves #1417.

This commit is contained in:
Griatch 2017-09-10 17:56:28 +02:00
parent 10cd8123d6
commit f68674fea9
2 changed files with 11 additions and 3 deletions

View file

@ -1875,10 +1875,17 @@ class CmdLock(ObjManipCommand):
caller.msg("Added lock '%s' to %s." % (lockdef, obj)) caller.msg("Added lock '%s' to %s." % (lockdef, obj))
return return
# if we get here, we are just viewing all locks # if we get here, we are just viewing all locks on obj
obj = None
if self.lhs.startswith("*"):
obj = caller.search_account(self.lhs.lstrip("*"))
if not obj:
obj = caller.search(self.lhs) obj = caller.search(self.lhs)
if not obj: 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
caller.msg("\n".join(obj.locks.all())) caller.msg("\n".join(obj.locks.all()))

View file

@ -19,6 +19,7 @@ from evennia.scripts.scripthandler import ScriptHandler
from evennia.commands import cmdset, command from evennia.commands import cmdset, command
from evennia.commands.cmdsethandler import CmdSetHandler from evennia.commands.cmdsethandler import CmdSetHandler
from evennia.commands import cmdhandler from evennia.commands import cmdhandler
from evennia.utils import search
from evennia.utils import logger from evennia.utils import logger
from evennia.utils.utils import (variable_from_module, lazy_property, from evennia.utils.utils import (variable_from_module, lazy_property,
make_iter, to_unicode, is_iter) make_iter, to_unicode, is_iter)
@ -435,7 +436,7 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)):
if searchdata.lower() in ("me", "self",): if searchdata.lower() in ("me", "self",):
return [self.account] if quiet else self.account return [self.account] if quiet else self.account
results = self.account.__class__.objects.account_search(searchdata) results = search.search_account(searchdata)
if quiet: if quiet:
return results return results