verbose error msgs when model and spec get out-of-sync
This commit is contained in:
parent
b4c9aa5cab
commit
1d31baefae
|
|
@ -147,6 +147,14 @@ class DistributedLevel(DistributedObject.DistributedObject,
|
|||
self.privGotSpec(levelSpec)
|
||||
|
||||
if __dev__:
|
||||
def reportModelSpecSyncError(self, msg):
|
||||
DistributedLevel.notify.error(
|
||||
'%s\n'
|
||||
'\n'
|
||||
'your spec does not match the level model\n'
|
||||
'use SpecUtil.updateSpec, then restart your AI and client' %
|
||||
(msg))
|
||||
|
||||
def setSpecDeny(self, reason):
|
||||
DistributedLevel.notify.error(reason)
|
||||
|
||||
|
|
@ -186,9 +194,8 @@ class DistributedLevel(DistributedObject.DistributedObject,
|
|||
modelZoneNums = self.zoneNums
|
||||
entityZoneNums = self.zoneNum2entId.keys()
|
||||
if not sameElements(modelZoneNums, entityZoneNums):
|
||||
DistributedLevel.notify.error(
|
||||
'model zone nums (%s) do not match entity zone nums (%s)\n'
|
||||
'use SpecUtil.updateSpec' %
|
||||
self.reportModelSpecSyncError(
|
||||
'model zone nums (%s) do not match entity zone nums (%s)' %
|
||||
(modelZoneNums, entityZoneNums))
|
||||
|
||||
# load stuff
|
||||
|
|
@ -324,7 +331,7 @@ class DistributedLevel(DistributedObject.DistributedObject,
|
|||
self.stopOuch()
|
||||
|
||||
def getZoneNode(self, zoneNum):
|
||||
return self.zoneNum2node[zoneNum]
|
||||
return self.zoneNum2node.get(zoneNum)
|
||||
|
||||
def requestReparent(self, entity, parentId):
|
||||
if __debug__:
|
||||
|
|
|
|||
|
|
@ -8,6 +8,11 @@ class ZoneEntity(ZoneEntityBase.ZoneEntityBase, BasicEntities.NodePathAttribs):
|
|||
ZoneEntityBase.ZoneEntityBase.__init__(self, level, entId)
|
||||
|
||||
self.nodePath = self.level.getZoneNode(self.modelZoneNum)
|
||||
if __dev__:
|
||||
if self.nodePath is None:
|
||||
self.level.reportModelSpecSyncError(
|
||||
'unknown modelZoneNum %s; zone was removed from model?' %
|
||||
self.modelZoneNum)
|
||||
BasicEntities.NodePathAttribs.initNodePathAttribs(self, doReparent=0)
|
||||
|
||||
# dict of zoneNum to 'visible' reference count
|
||||
|
|
|
|||
Loading…
Reference in New Issue