Browse Source

added warnings

Darren Ranalli 19 years ago
parent
commit
dbddb3bb2b
1 changed files with 8 additions and 1 deletions
  1. 8 1
      direct/src/distributed/DoCollectionManager.py

+ 8 - 1
direct/src/distributed/DoCollectionManager.py

@@ -217,13 +217,17 @@ class DoCollectionManager:
         distObj = self.doId2do.get(self.getMsgChannel())
         distObj = self.doId2do.get(self.getMsgChannel())
         if distObj is not None:
         if distObj is not None:
             distObj.setLocation(parentId, zoneId)
             distObj.setLocation(parentId, zoneId)
+        else:
+            self.notify.warning('handleSetLocation: object %s not present' % self.getMsgChannel())
 
 
     def storeObjectLocation(self, doId, parentId, zoneId, object=None):
     def storeObjectLocation(self, doId, parentId, zoneId, object=None):
         if (object == None):
         if (object == None):
             obj = self.doId2do.get(doId)
             obj = self.doId2do.get(doId)
         else:
         else:
             obj = object
             obj = object
-        if obj is not None:
+        if obj is None:
+            self.notify.warning('storeObjectLocation: object %s not present' % doId)
+        else:
             oldParentId = obj.parentId
             oldParentId = obj.parentId
             oldZoneId = obj.zoneId
             oldZoneId = obj.zoneId
             if oldParentId != parentId:
             if oldParentId != parentId:
@@ -253,6 +257,9 @@ class DoCollectionManager:
                     parentObj = self.doId2do.get(parentId)
                     parentObj = self.doId2do.get(parentId)
                     if parentObj is not None:
                     if parentObj is not None:
                         parentObj.handleChildArrive(obj, zoneId)
                         parentObj.handleChildArrive(obj, zoneId)
+                    elif parentId not in (0, self.getGameDoId()):
+                        self.notify.warning('storeObjectLocation(%s): parent %s not present' %
+                                            (doId, parentId))
 
 
     def deleteObjectLocation(self, doId, parentId, zoneId):
     def deleteObjectLocation(self, doId, parentId, zoneId):
         # Do not worry about null values
         # Do not worry about null values