Forráskód Böngészése

From Darren: fix for scratch pad dummy task crash

Asad M. Zaman 17 éve
szülő
commit
24b0ce64e2
1 módosított fájl, 7 hozzáadás és 2 törlés
  1. 7 2
      direct/src/distributed/DistributedSmoothNodeBase.py

+ 7 - 2
direct/src/distributed/DistributedSmoothNodeBase.py

@@ -4,7 +4,10 @@ from ClockDelta import *
 from direct.task import Task
 from direct.showbase.PythonUtil import randFloat, Enum
 
-DummyTask = ScratchPad()
+class DummyTask:
+    def setDelay(self, blah):
+        pass
+
     
 class DistributedSmoothNodeBase:
     """common base class for DistributedSmoothNode and DistributedSmoothNodeAI
@@ -95,10 +98,12 @@ class DistributedSmoothNodeBase:
             taskMgr.doMethodLater(self.__broadcastPeriod + delay,
                                   self._posHprBroadcast, taskName)
 
-    def _posHprBroadcast(self, task=DummyTask):
+    def _posHprBroadcast(self, task=None):
         # TODO: we explicitly stagger the initial task timing in
         # startPosHprBroadcast; we should at least make an effort to keep
         # this task accurately aligned with its period and starting time.
+        if task is None:
+            task = DummyTask()
         self.d_broadcastPosHpr()
         task.setDelay(self.__broadcastPeriod)
         return Task.again