Protect against crash on disable

This commit is contained in:
Greg Wiatroski 2007-04-03 21:47:12 +00:00
parent a23e77bde1
commit b39ca2fec5
1 changed files with 9 additions and 7 deletions

View File

@ -65,13 +65,15 @@ class ParticleEffect(NodePath):
def disable(self):
self.detachNode()
for p in self.particlesDict.values():
p.setRenderParent(p.node)
for f in self.forceGroupDict.values():
f.disable()
for p in self.particlesDict.values():
p.disable()
self.fEnabled = 0
# band-aid added for client crash - grw
if hasattr(self, 'forceGroupDict') and hasattr(self, 'particlesDict'):
for p in self.particlesDict.values():
p.setRenderParent(p.node)
for f in self.forceGroupDict.values():
f.disable()
for p in self.particlesDict.values():
p.disable()
self.fEnabled = 0
def isEnabled(self):
"""