mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
don't crash out with duplicate doId on LIVE
This commit is contained in:
parent
bdf6973526
commit
0ca5963d3b
@ -60,10 +60,16 @@ class DoHierarchy:
|
|||||||
|
|
||||||
def storeObjectLocation(self, do, parentId, zoneId):
|
def storeObjectLocation(self, do, parentId, zoneId):
|
||||||
doId = do.doId
|
doId = do.doId
|
||||||
if doId in self._allDoIds:
|
# until we figure out why Toontown is crashing with duplicate Toon generates, don't do the check on LIVE
|
||||||
self.notify.error(
|
try:
|
||||||
'storeObjectLocation(%s %s) already in _allDoIds; duplicate generate()? or didn\'t clean up previous instance of DO?' % (
|
isLive = base.cr.isLive()
|
||||||
do.__class__.__name__, do.doId))
|
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, {})
|
parentZoneDict = self._table.setdefault(parentId, {})
|
||||||
zoneDoSet = parentZoneDict.setdefault(zoneId, set())
|
zoneDoSet = parentZoneDict.setdefault(zoneId, set())
|
||||||
zoneDoSet.add(doId)
|
zoneDoSet.add(doId)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user