From 0ca5963d3b757b9470f752a60d6ec118d96c45d7 Mon Sep 17 00:00:00 2001 From: Darren Ranalli Date: Tue, 21 Nov 2006 04:09:25 +0000 Subject: [PATCH] don't crash out with duplicate doId on LIVE --- direct/src/distributed/DoHierarchy.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/direct/src/distributed/DoHierarchy.py b/direct/src/distributed/DoHierarchy.py index e06572ab2e..7e839f47b4 100755 --- a/direct/src/distributed/DoHierarchy.py +++ b/direct/src/distributed/DoHierarchy.py @@ -60,10 +60,16 @@ class DoHierarchy: def storeObjectLocation(self, do, parentId, zoneId): doId = do.doId - if doId in self._allDoIds: - self.notify.error( - 'storeObjectLocation(%s %s) already in _allDoIds; duplicate generate()? or didn\'t clean up previous instance of DO?' % ( - do.__class__.__name__, do.doId)) + # until we figure out why Toontown is crashing with duplicate Toon generates, don't do the check on LIVE + try: + isLive = base.cr.isLive() + except: + isLive = True + if not isLive: + if doId in self._allDoIds: + self.notify.error( + 'storeObjectLocation(%s %s) already in _allDoIds; duplicate generate()? or didn\'t clean up previous instance of DO?' % ( + do.__class__.__name__, do.doId)) parentZoneDict = self._table.setdefault(parentId, {}) zoneDoSet = parentZoneDict.setdefault(zoneId, set()) zoneDoSet.add(doId)