account for global searches

This commit is contained in:
InspectorCaracal 2024-12-02 18:41:10 -07:00 committed by Cal
parent 989deafb92
commit f2083ae9f9

View file

@ -549,12 +549,13 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase):
""" """
if isinstance(searchdata, str): if isinstance(searchdata, str):
candidates = kwargs.get("candidates", []) candidates = kwargs.get("candidates") or []
global_search = kwargs.get("global_search", False)
match searchdata.lower(): match searchdata.lower():
case "me" | "self": case "me" | "self":
return self in candidates, self return global_search or self in candidates, self
case "here": case "here":
return self.location in candidates, self.location return global_search or self.location in candidates, self.location
return False, searchdata return False, searchdata
def get_search_candidates(self, searchdata, **kwargs): def get_search_candidates(self, searchdata, **kwargs):