Browse Source

better handling of toon falling out of world

Darren Ranalli 22 years ago
parent
commit
51d58744c9
1 changed files with 3 additions and 1 deletions
  1. 3 1
      direct/src/showbase/PhysicsWalker.py

+ 3 - 1
direct/src/showbase/PhysicsWalker.py

@@ -230,7 +230,9 @@ class PhysicsWalker(DirectObject.DirectObject):
         # hack fix for falling through the floor:
         if contact==Vec3.zero() and self.avatarNodePath.getZ()<-50.0:
             # reset:
-            self.avatarNodePath.setPos(Vec3(0.0, 0.0, 20.0))
+            # DCR: don't reset X and Y; allow player to move
+            self.avatarNodePath.setZ(50.0)
+            self.resetPhys()
 
         # Determine what the speeds are based on the buttons:
         self.__speed=(self.__forwardButton and self.avatarControlForwardSpeed or