Browse Source

don't re-initialize the smoother in sendCurrentPosition if we're in the middle of broadcasting

Darren Ranalli 18 years ago
parent
commit
11066cc96b
1 changed files with 4 additions and 1 deletions
  1. 4 1
      direct/src/distributed/DistributedSmoothNodeBase.py

+ 4 - 1
direct/src/distributed/DistributedSmoothNodeBase.py

@@ -12,6 +12,7 @@ class DistributedSmoothNodeBase:
     def __init__(self):
         self.cnode = CDistributedSmoothNodeBase()
         self.cnode.setClockDelta(globalClockDelta)
+        self.d_broadcastPosHpr = None
 
     def delete(self):
         # make sure our task is gone
@@ -87,5 +88,7 @@ class DistributedSmoothNodeBase:
         return Task.again
 
     def sendCurrentPosition(self):
-        self.cnode.initialize(self, self.dclass, self.doId)
+        # if we're not currently broadcasting, make sure things are set up
+        if self.d_broadcastPosHpr is None:
+            self.cnode.initialize(self, self.dclass, self.doId)
         self.cnode.sendEverything()