From 196f1ad27017ae0aea8f888e79ef5184256ca788 Mon Sep 17 00:00:00 2001 From: Griatch Date: Wed, 12 Oct 2016 23:28:56 +0200 Subject: [PATCH] Change so typeclass equality is not only based on dbid but also on model. --- evennia/typeclasses/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/evennia/typeclasses/models.py b/evennia/typeclasses/models.py index afbe57616..77dd246bb 100644 --- a/evennia/typeclasses/models.py +++ b/evennia/typeclasses/models.py @@ -339,7 +339,10 @@ class TypedObject(SharedMemoryModel): # def __eq__(self, other): - return other and hasattr(other, 'dbid') and self.dbid == other.dbid + try: + return self.__dbclass__ == other.__dbclass__ and self.dbid == other.dbid + except AttributeError: + return False def __str__(self): return smart_str("%s" % self.db_key)