diff --git a/Source/Game/Player/PlayerMovement.cs b/Source/Game/Player/PlayerMovement.cs index ece5ae0..218a950 100644 --- a/Source/Game/Player/PlayerMovement.cs +++ b/Source/Game/Player/PlayerMovement.cs @@ -58,6 +58,7 @@ namespace Game private const float jumpBoostVelocity = 100f; private const int jumpBoostMaxJumps = 2; private const bool jumpStairBehavior = true; + private const bool jumpAdditive = true; private const float maxAirSpeed = 320f; private const float maxAirStrafeSpeed = 30f; @@ -964,14 +965,18 @@ namespace Game // Reset velocity from gravity if (-Vector3.Dot(Gravity.Normalized, velocity) < 0 && Vector3.Dot(velocity, traceGround.hitNormal) < -0.1) + { velocity = Vector3.ProjectOnPlane(velocity, traceGround.hitNormal); + } - velocity += Vector3.Up * jumpVel; - - bool ktjump = true; - if (ktjump) + if (jumpAdditive) + { + velocity += Vector3.Up * jumpVel; if (velocity.Y < jumpVel) velocity.Y = jumpVel; + } + else + velocity = Vector3.Up * jumpVel; onGround = false;