diff demos/shooter/scripts/common/baseobject.py @ 476:78a1eb57c074

Changed the way instances get deleted from the scene. Instances now get removed at the end of the frame as opposed to after their explosion action is complete. The old way was causing the odd segfault because the instance was being removed before FIFE was finished with it.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Thu, 22 Apr 2010 01:18:44 +0000
parents b78020d31186
children 6b33d80b468b
line wrap: on
line diff
--- a/demos/shooter/scripts/common/baseobject.py	Wed Apr 21 18:20:13 2010 +0000
+++ b/demos/shooter/scripts/common/baseobject.py	Thu Apr 22 01:18:44 2010 +0000
@@ -112,10 +112,10 @@
 		self._velocity.y += (norm.y * (self._scene.timedelta/1000.0))/self._yscale
 		
 	def removeFromScene(self):
-		self._scene.removeObjectFromScene(self)
-		if self._instance:
-			self._layer.deleteInstance(self._instance)
-			self._instance = None
+		self._scene.queueObjectForRemoval(self)
+#		if self._instance:
+#			self._layer.deleteInstance(self._instance)
+#			self._instance = None
 
 	def _isRunning(self):
 		return self._running