mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
fix diagonal-running speed exploit
This commit is contained in:
parent
63f0e86da0
commit
f3fe23c877
@ -28,6 +28,8 @@ class GravityWalker(DirectObject.DirectObject):
|
||||
wantFloorSphere = base.config.GetBool('want-floor-sphere', 0)
|
||||
earlyEventSphere = base.config.GetBool('early-event-sphere', 0)
|
||||
|
||||
DiagonalFactor = math.sqrt(2.) / 2.
|
||||
|
||||
# special methods
|
||||
def __init__(self, gravity = -32.1740, standableGround=0.707,
|
||||
hardLandingForce=16.0):
|
||||
@ -502,6 +504,10 @@ class GravityWalker(DirectObject.DirectObject):
|
||||
(turnLeft and self.avatarControlRotateSpeed) or
|
||||
(turnRight and -self.avatarControlRotateSpeed))
|
||||
|
||||
if self.speed and self.slideSpeed:
|
||||
self.speed *= GravityWalker.DiagonalFactor
|
||||
self.slideSpeed *= GravityWalker.DiagonalFactor
|
||||
|
||||
debugRunning = inputState.isSet("debugRunning")
|
||||
if(debugRunning):
|
||||
self.speed*=base.debugRunningMultiplier
|
||||
|
Loading…
x
Reference in New Issue
Block a user