mirror of
https://github.com/evennia/evennia.git
synced 2026-03-27 10:16:32 +01:00
Further caching and optimization, making some operations noticeable faster in the end.
This commit is contained in:
parent
1a6ef5d983
commit
6e08c011a1
13 changed files with 78 additions and 73 deletions
|
|
@ -353,16 +353,14 @@ class Object(TypeClass):
|
|||
This has be located at this level, having it in the
|
||||
parent doesn't work.
|
||||
"""
|
||||
result = self.id == other
|
||||
if not result and hasattr(other, "id"):
|
||||
result = self.id == other.id
|
||||
if not result:
|
||||
try:
|
||||
return self.dbref == other or self.dbref == other.dbref
|
||||
except AttributeError:
|
||||
# compare players instead
|
||||
try:
|
||||
result = other and self.user.id == other.user.id
|
||||
return self.player.uid == other or self.player.uid == other.player.uid
|
||||
except AttributeError:
|
||||
pass
|
||||
return result
|
||||
|
||||
return False
|
||||
|
||||
## hooks called by the game engine
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue