Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tools.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools.py')
-rw-r--r--tools.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/tools.py b/tools.py
index d61f748..8a34f12 100644
--- a/tools.py
+++ b/tools.py
@@ -218,14 +218,15 @@ class DestroyTool(Tool):
self.vertices.pop(0)
tokill = self.game.world.get_bodies_at_pos(pygame.mouse.get_pos())
if tokill:
- joint = tokill[0].GetJointList()
- if joint:
- self.game.bridge.joint_deleted()
- while joint.next:
- joint = joint.next
- self.game.bridge.joint_deleted()
- self.game.world.world.DestroyBody(tokill[0])
- self.game.bridge.box_deleted()
+ jointnode = tokill[0].GetJointList()
+ if jointnode:
+ joint = jointnode.joint
+ self.game.bridge.joint_deleted(joint)
+ while joint.GetNext():
+ joint = joint.GetNext()
+ self.game.bridge.joint_deleted(joint)
+ self.game.world.world.DestroyBody(tokill[0])
+ self.game.bridge.box_deleted()
elif event.type == MOUSEBUTTONUP and event.button == 1:
self.cancel()
def draw(self):