fixed distributed entity create-announce bug

This commit is contained in:
Darren Ranalli 2003-09-25 01:12:31 +00:00
parent b1827d12e7
commit 538f856f6f
2 changed files with 6 additions and 2 deletions

View File

@ -33,6 +33,8 @@ class DistributedEntity(DistributedObject.DistributedObject, Entity.Entity):
# ask our level obj for our spec data
level = toonbase.tcr.doId2do[self.levelDoId]
self.initializeEntity(level, self.entId)
# announce our presence (Level does this for non-distributed entities)
self.level.onEntityCreate(self.entId)
DistributedObject.DistributedObject.announceGenerate(self)

View File

@ -192,14 +192,16 @@ class DistributedLevel(DistributedObject.DistributedObject,
def requestReparent(self, entity, parentId):
assert(entity.entId != parentId)
if self.entities.has_key(parentId):
parent = self.getEntity(parentId)
if parent is not None:
# parent has already been created
entity.reparentTo(self.entities[parentId].getNodePath())
entity.reparentTo(parent.getNodePath())
else:
# parent hasn't been created yet; schedule the reparent
self.notify.debug(
'entity %s requesting reparent to %s, not yet created' %
(entity, parentId))
print self.entities
entId = entity.entId
entity.reparentTo(hidden)