mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -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)
|
wantFloorSphere = base.config.GetBool('want-floor-sphere', 0)
|
||||||
earlyEventSphere = base.config.GetBool('early-event-sphere', 0)
|
earlyEventSphere = base.config.GetBool('early-event-sphere', 0)
|
||||||
|
|
||||||
|
DiagonalFactor = math.sqrt(2.) / 2.
|
||||||
|
|
||||||
# special methods
|
# special methods
|
||||||
def __init__(self, gravity = -32.1740, standableGround=0.707,
|
def __init__(self, gravity = -32.1740, standableGround=0.707,
|
||||||
hardLandingForce=16.0):
|
hardLandingForce=16.0):
|
||||||
@ -502,6 +504,10 @@ class GravityWalker(DirectObject.DirectObject):
|
|||||||
(turnLeft and self.avatarControlRotateSpeed) or
|
(turnLeft and self.avatarControlRotateSpeed) or
|
||||||
(turnRight and -self.avatarControlRotateSpeed))
|
(turnRight and -self.avatarControlRotateSpeed))
|
||||||
|
|
||||||
|
if self.speed and self.slideSpeed:
|
||||||
|
self.speed *= GravityWalker.DiagonalFactor
|
||||||
|
self.slideSpeed *= GravityWalker.DiagonalFactor
|
||||||
|
|
||||||
debugRunning = inputState.isSet("debugRunning")
|
debugRunning = inputState.isSet("debugRunning")
|
||||||
if(debugRunning):
|
if(debugRunning):
|
||||||
self.speed*=base.debugRunningMultiplier
|
self.speed*=base.debugRunningMultiplier
|
||||||
|
Loading…
x
Reference in New Issue
Block a user