Fixed and debugged object_search to more generically search for any attribute name except 'key' (issue110). Also included alias-search as a last-resort if normal searches fail. This is now also working for global searches (issue106).
This commit is contained in:
parent
7e736d19e2
commit
8bedd4d793
5 changed files with 184 additions and 176 deletions
|
|
@ -55,7 +55,7 @@ class ObjManipCommand(MuxCommand):
|
|||
if ';' in objdef:
|
||||
objdef, aliases = [str(part).strip()
|
||||
for part in objdef.split(';', 1)]
|
||||
aliases = [str(alias).strip().lower()
|
||||
aliases = [str(alias).strip()
|
||||
for alias in aliases.split(';') if alias.strip()]
|
||||
lhs_objs.append({"name":objdef,
|
||||
'option': option, 'aliases': aliases})
|
||||
|
|
@ -70,7 +70,7 @@ class ObjManipCommand(MuxCommand):
|
|||
if ';' in objdef:
|
||||
objdef, aliases = [str(part).strip()
|
||||
for part in objdef.split(';', 1)]
|
||||
aliases = [str(alias).strip().lower()
|
||||
aliases = [str(alias).strip()
|
||||
for alias in aliases.split(';') if alias.strip()]
|
||||
rhs_objs.append({"name":objdef, 'option': option, 'aliases': aliases})
|
||||
|
||||
|
|
@ -1026,7 +1026,7 @@ class CmdDig(ObjManipCommand):
|
|||
caller = self.caller
|
||||
|
||||
if not self.lhs:
|
||||
string = "Usage: @dig[/teleport] roomname[:parent] [= exit_there"
|
||||
string = "Usage: @dig[/teleport] roomname[;alias;alias...][:parent] [= exit_there"
|
||||
string += "[;alias;alias..][:parent]] "
|
||||
string += "[, exit_back_here[;alias;alias..][:parent]]"
|
||||
caller.msg(string)
|
||||
|
|
@ -1426,7 +1426,6 @@ class CmdExamine(ObjManipCommand):
|
|||
text = "%s[...]" % text[:line_width - headlen - 5]
|
||||
return text
|
||||
|
||||
|
||||
def format_attributes(self, obj, attrname=None):
|
||||
"""
|
||||
Helper function that returns info about attributes and/or
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue