mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
prevent parentMgr crashes
This commit is contained in:
parent
27ab160e8f
commit
dbc4e3edf4
@ -106,7 +106,8 @@ class DistributedNode(DistributedObject.DistributedObject, NodePath):
|
||||
justGotRequiredParentAsStr = ((not self.isGenerated()) and
|
||||
self.gotStringParentToken)
|
||||
if not justGotRequiredParentAsStr:
|
||||
self.do_setParent(parentToken)
|
||||
if parentToken != 0:
|
||||
self.do_setParent(parentToken)
|
||||
self.gotStringParentToken = 0
|
||||
|
||||
def do_setParent(self, parentToken):
|
||||
|
@ -66,7 +66,11 @@ class DistributedNodeAI(DistributedObjectAI.DistributedObjectAI, NodePath):
|
||||
|
||||
def setParent(self, parentToken):
|
||||
self.notify.debug('setParent(%s): %s' % (self.doId, parentToken))
|
||||
self.do_setParent(parentToken)
|
||||
if parentToken == 0:
|
||||
senderId = self.air.getAvatarIdFromSender()
|
||||
self.air.writeServerEvent('suspicious', senderId, 'setParent(0)')
|
||||
else:
|
||||
self.do_setParent(parentToken)
|
||||
|
||||
def do_setParent(self, parentToken):
|
||||
self.getParentMgr().requestReparent(self, parentToken)
|
||||
|
Loading…
x
Reference in New Issue
Block a user