Browse Source

doneBarrier() may be legally be called with no barrier received

David Rose 22 years ago
parent
commit
ac53a4e660
1 changed files with 8 additions and 3 deletions
  1. 8 3
      direct/src/distributed/DistributedObject.py

+ 8 - 3
direct/src/distributed/DistributedObject.py

@@ -304,8 +304,13 @@ class DistributedObject(PandaObject):
         
     def doneBarrier(self):
         # Tells the AI we have finished handling our task.
-        assert(self.__barrierContext != None)
-        self.sendUpdate("doBarrierReady", [self.__barrierContext])
-        self.__barrierContext = None
+
+        # If this is None, it either means we have called
+        # doneBarrier() twice, or we have not received a barrier
+        # context from the AI.  I think in either case it's ok to
+        # silently ignore the error.
+        if self.__barrierContext != None:
+            self.sendUpdate("doBarrierReady", [self.__barrierContext])
+            self.__barrierContext = None