diff options
author | Brian Jordan <bcjordan@gmail.com> | 2009-07-10 13:49:43 (GMT) |
---|---|---|
committer | Brian Jordan <bcjordan@gmail.com> | 2009-07-10 13:49:43 (GMT) |
commit | 5284e89a7e0d3cf794d435bed6cfa4926e95d55a (patch) | |
tree | 506b8b427949564e069015b813ac9ff4013002fa /tools.py | |
parent | da351cb11c9cc0a36492c9f50fa993afb4465c3b (diff) |
Make destroy tool unpin an object (Trac #990)
Diffstat (limited to 'tools.py')
-rw-r--r-- | tools.py | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -402,11 +402,15 @@ class DestroyTool(Tool): self.vertices.append(pygame.mouse.get_pos()) if len(self.vertices) > 10: self.vertices.pop(0) + tokill = self.game.world.get_bodies_at_pos(pygame.mouse.get_pos()) - #self.game.world.world.DestroyJoint( - #jointlist = tokill[0].GetJointList() - #print jointlist.joint + if tokill: + jointnode = tokill[0].GetJointList() + if jointnode: + joint = jointnode.joint + self.game.world.world.DestroyJoint(joint) + else: self.game.world.world.DestroyBody(tokill[0]) elif event.type == MOUSEBUTTONUP and event.button == 1: self.cancel() |