fixed distributed entity create-announce bug
This commit is contained in:
parent
b1827d12e7
commit
538f856f6f
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue