sugarlabs / physics

a box2d playpen
GNU General Public License v3.0
7 stars 26 forks source link

This should fix the reported issue #21. #22

Closed nicholaskernan closed 7 years ago

nicholaskernan commented 7 years ago

The groundBody does not have userData. Therefore it produces the traceback reported in issue #21.

quozl commented 7 years ago

Tested, does fix #21.

Reviewed. I'm fine with merging as is.

However, for perfection;

@@ -476,35 +476,36 @@ def get_world_model(self, ...

         bodylist = []
         for body in self.world.bodies:
+            if body == self.world.groundBody:
+                continue
             body.userData["saveid"] = save_id_index  # set temporary data
             ...
nicholaskernan commented 7 years ago

I modified the code and commit message based on your suggestions. Thanks.