Explorar o código

don't assert that entity is not in list, warn

Darren Ranalli %!s(int64=22) %!d(string=hai) anos
pai
achega
dbad841ac4
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      direct/src/level/Level.py

+ 6 - 1
direct/src/level/Level.py

@@ -202,7 +202,12 @@ class Level:
         # entity is initialized, add it to the list of entities
         # entity is initialized, add it to the list of entities
         # if this assert fails, check distributed entities to make sure
         # if this assert fails, check distributed entities to make sure
         # they're calling down to Entity.destroy
         # they're calling down to Entity.destroy
-        assert not entId in self.entities
+        if __debug__:
+            if entId in self.entities:
+                self.notify.warning(
+                    'entity %s already in entity table... '
+                    'make sure distributedEntity is calling down to '
+                    'Entity.destroy!')
         self.entities[entId] = entity
         self.entities[entId] = entity
 
 
     def getEntity(self, entId):
     def getEntity(self, entId):