Cleanup body association for ray polys we discard. Add missed call to update_shapes
[tabakrolletjie.git] / tabakrolletjie / rays.py
index ac51802d2d91315aa2eb5ef07be175b62e1ef89c..9db09a2a62ee5b388609ac237c476b813ac0897a 100644 (file)
@@ -109,6 +109,8 @@ class RayPolyManager(object):
     def update_shapes(self):
         if self._old_poly_cache:
             self._space.remove(*self._old_poly_cache)
+            for poly in self._old_poly_cache:
+                poly.body = None
         new_polys = self._old_poly_cache = self.polys()
         self._space.add(*new_polys)