diff options
author | Walter Bender <walter@sugarlabs.org> | 2014-02-11 17:02:23 (GMT) |
---|---|---|
committer | Walter Bender <walter@sugarlabs.org> | 2014-02-11 17:02:23 (GMT) |
commit | 7858fe04c77411ba04c7ed836eb3c4fadf43412a (patch) | |
tree | d3bfc84c9d2caa1887587ba2f581a5952210ab47 /tools.py | |
parent | acc7eef6e5be2bdb1fdd387b06b033bd3b3eb9d1 (diff) |
find_body doesn't return a list
Diffstat (limited to 'tools.py')
-rw-r--r-- | tools.py | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -773,26 +773,26 @@ class DestroyTool(Tool): if len(self.vertices) > 10: self.vertices.pop(0) - tokill = find_body(self.game.world, event.pos) - if tokill is not None: + body_to_remove = find_body(self.game.world, event.pos) + if body_to_remove is not None: tracklist = self.game.trackinfo.items() destroyed_body = False for key, info in tracklist: trackdex = info[4] - if 'track_indices' in tokill[0].userData and \ - trackdex in tokill[0].userData['track_indices'] and \ - info[3] is False: + if 'track_indices' in body_to_remove.userData and \ + trackdex in body_to_remove.userData['track_indices'] \ + and info[3] is False: self.game.world.world.DestroyBody(info[1]) self.game.trackinfo[key][3] = True destroyed_body = True break - jointnode = tokill[0].GetJointList() + jointnode = body_to_remove.GetJointList() if jointnode and not destroyed_body: joint = jointnode.joint self.game.world.world.DestroyJoint(joint) elif not destroyed_body: - self.game.world.world.DestroyBody(tokill[0]) + self.game.world.world.DestroyBody(body_to_remove) elif event.type == MOUSEBUTTONUP and event.button == 1: self.cancel() |