From ac53a4e6600f7bafbb958f9b488616a41a14fca1 Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 6 Nov 2003 06:54:34 +0000 Subject: [PATCH] doneBarrier() may be legally be called with no barrier received --- direct/src/distributed/DistributedObject.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/direct/src/distributed/DistributedObject.py b/direct/src/distributed/DistributedObject.py index 154d67af90..2b899f927c 100644 --- a/direct/src/distributed/DistributedObject.py +++ b/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