diff demos/shooter/scripts/common/baseobject.py @ 473:b78020d31186

Small update to ensure python doesn't try to delete objects that FIFE owns.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Tue, 20 Apr 2010 20:36:58 +0000
parents ac0f62a07a3e
children 78a1eb57c074
line wrap: on
line diff
--- a/demos/shooter/scripts/common/baseobject.py	Fri Apr 16 21:44:18 2010 +0000
+++ b/demos/shooter/scripts/common/baseobject.py	Tue Apr 20 20:36:58 2010 +0000
@@ -42,6 +42,7 @@
 			
 		if findInstance:
 			self._instance = self._layer.getInstance(self._name)
+			self._instance.thisown = 0
 		else:
 			self._instnace = None
 		
@@ -112,7 +113,9 @@
 		
 	def removeFromScene(self):
 		self._scene.removeObjectFromScene(self)
-		self._layer.deleteInstance(self._instance)
+		if self._instance:
+			self._layer.deleteInstance(self._instance)
+			self._instance = None
 
 	def _isRunning(self):
 		return self._running