mirror of
https://github.com/evennia/evennia.git
synced 2026-03-22 15:56:30 +01:00
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
|
|
@ -142,7 +142,14 @@ def local_and_global_search(searcher, ostring, search_contents=True, search_loca
|
|||
dbref_match = list(dbref_results)
|
||||
if len(dbref_match) > 0:
|
||||
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 = []
|
||||
# Handle our location/contents searches. list_search_object_namestr() does
|
||||
# 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:
|
||||
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
|
||||
|
||||
def is_dbref(dbstring):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue