# HG changeset patch # User prock@33b003aa-7bff-0310-803a-e67f0ece8222 # Date 1271795818 0 # Node ID b78020d31186657c1b09f722e2aad808f929a280 # Parent 3164715a0621a9a3d700839dc63935f814d6d685 Small update to ensure python doesn't try to delete objects that FIFE owns. diff -r 3164715a0621 -r b78020d31186 demos/shooter/scripts/common/baseobject.py --- 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 diff -r 3164715a0621 -r b78020d31186 demos/shooter/scripts/weapons.py --- a/demos/shooter/scripts/weapons.py Fri Apr 16 21:44:18 2010 +0000 +++ b/demos/shooter/scripts/weapons.py Tue Apr 20 20:36:58 2010 +0000 @@ -45,6 +45,7 @@ def create(self, location): self._instance = self._layer.createInstance(self._obj, location.getExactLayerCoordinates(), "bullet") fife.InstanceVisual.create(self._instance) + self._instance.thisown = 0 def run(self, velocity, location): if not self._running: