# HG changeset patch # User prock@33b003aa-7bff-0310-803a-e67f0ece8222 # Date 1277221296 0 # Node ID cccff9b04f576d4390224ecb0c404aa3fe9191d1 # Parent 4cb5d0ed33a9346dccd0d9a68751b710ed1fc844 This fixes a problem where objects that leave the scene were not being removed from thee scene. Projectiles and enemies now get removed when they leave the scene. There should no longer be a segfault when you destroy the final boss. diff -r 4cb5d0ed33a9 -r cccff9b04f57 demos/shooter/scripts/scene.py --- a/demos/shooter/scripts/scene.py Fri Jun 18 19:49:13 2010 +0000 +++ b/demos/shooter/scripts/scene.py Tue Jun 22 15:41:36 2010 +0000 @@ -450,8 +450,21 @@ self.queueObjectForRemoval(obj) #self._world.renderBoundingBox(obj) - - + + """ + Do some more cleanup. Objects that leave the scene should be removed. + + @todo: Objects that leave the scene should be added to the scenes object removal + in the objects update function. The current implementation is much slower. + """ + + worldlist = self.getObjectsInRange(0, self._maxnodes) + + for obj in worldlist: + if obj.scenenodeid < leftnode: + self.queueObjectForRemoval(obj) + if obj.type == SHTR_PROJECTILE and obj.scenenodeid > rightnode: + self.queueObjectForRemoval(obj) def _getPlayer(self): return self._player