Browse Source

optimizations

Joe Shochet 22 years ago
parent
commit
ea262c92cb
2 changed files with 6 additions and 3 deletions
  1. 2 0
      direct/src/level/DistributedEntity.py
  2. 4 3
      direct/src/level/Entity.py

+ 2 - 0
direct/src/level/DistributedEntity.py

@@ -42,7 +42,9 @@ class DistributedEntity(DistributedObject.DistributedObject, Entity.Entity):
         DistributedEntity.notify.debug('disable (%s)' % self.entId)
         DistributedEntity.notify.debug('disable (%s)' % self.entId)
         # stop things
         # stop things
         self.destroy()
         self.destroy()
+        DistributedObject.DistributedObject.disable(self)
 
 
     def delete(self):
     def delete(self):
         DistributedEntity.notify.debug('delete')
         DistributedEntity.notify.debug('delete')
         # unload things
         # unload things
+        DistributedObject.DistributedObject.delete(self)

+ 4 - 3
direct/src/level/Entity.py

@@ -78,9 +78,10 @@ class Entity(DirectObject):
 
 
     # this will be called with each item of our spec data on initialization
     # this will be called with each item of our spec data on initialization
     def setAttribInit(self, attrib, value):
     def setAttribInit(self, attrib, value):
-        if hasattr(self, attrib):
-            Entity.notify.warning('%s already has member %s in %s' %
-                                  (self, attrib, lineInfo()[2]))
+        if __debug__:
+            if hasattr(self, attrib):
+                Entity.notify.warning('%s already has member %s in %s' %
+                                      (self, attrib, lineInfo()[2]))
         # TODO: we should probably put this crep in a dictionary
         # TODO: we should probably put this crep in a dictionary
         # rather than dump it into the entity's namespace
         # rather than dump it into the entity's namespace
         self.__dict__[attrib] = value
         self.__dict__[attrib] = value