Clear up handling of 'me' and 'here'.
This commit is contained in:
parent
1a996bbf7e
commit
f69313f950
1 changed files with 8 additions and 7 deletions
|
|
@ -143,6 +143,13 @@ def local_and_global_search(searcher, ostring, search_contents=True, search_loca
|
||||||
if len(dbref_match) > 0:
|
if len(dbref_match) > 0:
|
||||||
return dbref_match
|
return dbref_match
|
||||||
|
|
||||||
|
# If the search string is one of the following, return immediately with
|
||||||
|
# the appropriate result.
|
||||||
|
if searcher.get_location().dbref_match(ostring) or ostring == 'here':
|
||||||
|
return [searcher.get_location()]
|
||||||
|
elif ostring == 'me' and searcher:
|
||||||
|
return [searcher]
|
||||||
|
|
||||||
local_matches = []
|
local_matches = []
|
||||||
# Handle our location/contents searches. list_search_object_namestr() does
|
# Handle our location/contents searches. list_search_object_namestr() does
|
||||||
# name and dbref comparisons against search_query.
|
# name and dbref comparisons against search_query.
|
||||||
|
|
@ -151,12 +158,6 @@ def local_and_global_search(searcher, ostring, search_contents=True, search_loca
|
||||||
if search_location:
|
if search_location:
|
||||||
local_matches += list_search_object_namestr(searcher.get_location().get_contents(), search_query, limit_types=limit_types)
|
local_matches += list_search_object_namestr(searcher.get_location().get_contents(), search_query, limit_types=limit_types)
|
||||||
|
|
||||||
# If the object the invoker is in matches, add it as well.
|
|
||||||
if searcher.get_location().dbref_match(ostring) or ostring == 'here':
|
|
||||||
local_matches.append(searcher.get_location())
|
|
||||||
elif ostring == 'me' and searcher:
|
|
||||||
local_matches.append(searcher)
|
|
||||||
|
|
||||||
return local_matches
|
return local_matches
|
||||||
|
|
||||||
def is_dbref(dbstring):
|
def is_dbref(dbstring):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue