Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools.py b/tools.py
index 2aced3e..d9bace0 100644
--- a/tools.py
+++ b/tools.py
@@ -318,7 +318,10 @@ class JointTool(Tool):
self.jb2 = self.game.world.get_bodies_at_pos(event.pos)
# if we have two distinct bodies, add a distance joint!
if self.jb1 and self.jb2 and str(self.jb1) != str(self.jb2):
- self.game.world.add.joint(self.jb1[0],self.jb2[0],self.jb1pos,self.jb2pos)
+ self.game.world.add.joint(self.jb1[0],self.jb2[0],self.jb1pos,self.jb2pos)
+ elif self.jb1:
+ groundBody = self.game.world.world.GetGroundBody()
+ self.game.world.add.joint(self.jb1[0],groundBody,self.jb1pos,self.jb2pos)
# If there's only one body, add a fixed joint
elif self.jb2:
self.game.world.add.joint(self.jb2[0],self.jb2pos)