Browse Source

changed updateGridTask so it is not required to pass a task param

Justin Butler 20 years ago
parent
commit
491d9a08b4
1 changed files with 3 additions and 2 deletions
  1. 3 2
      direct/src/distributed/DistributedCartesianGridAI.py

+ 3 - 2
direct/src/distributed/DistributedCartesianGridAI.py

@@ -87,7 +87,7 @@ class DistributedCartesianGridAI(DistributedNodeAI.DistributedNodeAI,
         taskMgr.remove(self.taskName("updateGridTask"))
         self.updateTaskStarted = 0
 
-    def updateGridTask(self, task):
+    def updateGridTask(self, task=None):
         # Run through all grid objects and update their parents if needed
         for avId in self.gridObjects:
             av = self.gridObjects[avId]
@@ -97,7 +97,8 @@ class DistributedCartesianGridAI(DistributedNodeAI.DistributedNodeAI,
                 # we are out of the bounds of this current cell
                 self.handleAvatarZoneChange(av)
         # Do this every second, not every frame
-        task.delayTime = 1.0
+        if (task):
+            task.delayTime = 1.0
         return Task.again
 
     def handleAvatarZoneChange(self, av, useZoneId=-1):