mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Let caller.search_account query all Account classes. Resolves #1417.
This commit is contained in:
parent
10cd8123d6
commit
f68674fea9
2 changed files with 11 additions and 3 deletions
|
|
@ -1875,9 +1875,16 @@ class CmdLock(ObjManipCommand):
|
|||
caller.msg("Added lock '%s' to %s." % (lockdef, obj))
|
||||
return
|
||||
|
||||
# if we get here, we are just viewing all locks
|
||||
obj = caller.search(self.lhs)
|
||||
# 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)
|
||||
if not obj:
|
||||
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()))
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ from evennia.scripts.scripthandler import ScriptHandler
|
|||
from evennia.commands import cmdset, command
|
||||
from evennia.commands.cmdsethandler import CmdSetHandler
|
||||
from evennia.commands import cmdhandler
|
||||
from evennia.utils import search
|
||||
from evennia.utils import logger
|
||||
from evennia.utils.utils import (variable_from_module, lazy_property,
|
||||
make_iter, to_unicode, is_iter)
|
||||
|
|
@ -435,7 +436,7 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)):
|
|||
if searchdata.lower() in ("me", "self",):
|
||||
return [self.account] if quiet else self.account
|
||||
|
||||
results = self.account.__class__.objects.account_search(searchdata)
|
||||
results = search.search_account(searchdata)
|
||||
|
||||
if quiet:
|
||||
return results
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue