Browse Source

dont create a GridParent if you are not on the grid

Joe Shochet 20 years ago
parent
commit
fbe9a82379
1 changed files with 2 additions and 1 deletions
  1. 2 1
      direct/src/distributed/DistributedNode.py

+ 2 - 1
direct/src/distributed/DistributedNode.py

@@ -48,7 +48,8 @@ class DistributedNode(DistributedObject.DistributedObject, NodePath):
         DistributedObject.DistributedObject.setLocation(self, parentId, zoneId)
         DistributedObject.DistributedObject.setLocation(self, parentId, zoneId)
         parentObj = self.cr.doId2do.get(parentId)
         parentObj = self.cr.doId2do.get(parentId)
         if parentObj:
         if parentObj:
-            if parentObj.isGridParent():
+            # Make sure you in a zone that is in the grid before making a GridParent
+            if (parentObj.isGridParent() and (zoneId >= parentObj.startingZone)):
                 if not self.gridParent:
                 if not self.gridParent:
                     self.gridParent = GridParent.GridParent(self)
                     self.gridParent = GridParent.GridParent(self)
                 self.gridParent.setGridParent(parentObj, zoneId, teleport)
                 self.gridParent.setGridParent(parentObj, zoneId, teleport)