mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
protect against distrib entities destroyed after their level
This commit is contained in:
parent
98ecf0cd40
commit
1b515b56ee
@ -26,7 +26,14 @@ class Entity(DirectObject):
|
||||
return 'ent%s(%s)' % (self.entId, self.level.getEntityType(self.entId))
|
||||
|
||||
def destroy(self):
|
||||
self.level.onEntityDestroy(self.entId)
|
||||
Entity.notify.debug('Entity.destroy() %s' % self.entId)
|
||||
# client-side distributed entities might be doing this after
|
||||
# the level has been been destroyed...?
|
||||
if self.level.isInitialized():
|
||||
self.level.onEntityDestroy(self.entId)
|
||||
else:
|
||||
Entity.notify.warning('Entity %s destroyed after level??' %
|
||||
self.entid)
|
||||
del self.level
|
||||
del self.entId
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user