mirror of
https://github.com/evennia/evennia.git
synced 2026-03-26 17:56:32 +01:00
Fixed issues with batch-code processor not working correctly. Also added some better parsing. Resolves issue 221.
This commit is contained in:
parent
81e7a31072
commit
1ca8df9e70
5 changed files with 39 additions and 36 deletions
|
|
@ -191,7 +191,7 @@ class ObjectManager(TypedObjectManager):
|
|||
If None, the default 'key' attribute is used.
|
||||
location: If None, character.location will be used.
|
||||
"""
|
||||
#ostring = str(ostring).strip()
|
||||
ostring = to_unicode(ostring, force_string=True)
|
||||
|
||||
if not ostring:
|
||||
return []
|
||||
|
|
@ -210,16 +210,16 @@ class ObjectManager(TypedObjectManager):
|
|||
|
||||
if location and ostring == 'here':
|
||||
return [location]
|
||||
if caller and to_unicode(ostring) in ('me', 'self'):
|
||||
if caller and ostring in ('me', 'self'):
|
||||
return [caller]
|
||||
if caller and to_unicode(ostring) in ('*me', '*self'):
|
||||
if caller and ostring in ('*me', '*self'):
|
||||
return [caller]
|
||||
|
||||
# Test if we are looking for an object controlled by a
|
||||
# specific player
|
||||
|
||||
#logger.log_infomsg(str(type(ostring)))
|
||||
if to_unicode(ostring).startswith("*"):
|
||||
if ostring.startswith("*"):
|
||||
# Player search - try to find obj by its player's name
|
||||
player_match = self.get_object_with_player(ostring)
|
||||
if player_match is not None:
|
||||
|
|
|
|||
|
|
@ -31,16 +31,20 @@ class Object(TypeClass):
|
|||
|
||||
def __eq__(self, other):
|
||||
"""
|
||||
Checks for equality against an id string or another object or user.
|
||||
|
||||
This has be located at this level, having it in the
|
||||
parent doesn't work.
|
||||
"""
|
||||
|
||||
result = other and other.id == self.id
|
||||
try:
|
||||
uresult = other and (other.user.id == self.user.id)
|
||||
except AttributeError:
|
||||
uresult = False
|
||||
return result or uresult
|
||||
result = self.id == other
|
||||
if not result and hasattr(other, "id"):
|
||||
result = self.id == other.id
|
||||
if not result:
|
||||
try:
|
||||
result = other and self.user.id == other.user.id
|
||||
except AttributeError:
|
||||
pass
|
||||
return result
|
||||
|
||||
# hooks called by the game engine
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue