Skip to content

Commit

Permalink
Fix FULL_BHOP_FORWARD behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
liamlutton committed Jul 31, 2022
1 parent 86dca13 commit c66ca94
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Simulation/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ function Simulation:CrashLand(vel, cmd, ground)
local flat = Vector3.new(ground.normal.x, 0, ground.normal.z).Unit
local forward = MathUtils:PlayerAngleToVec(self.state.angle)

if (forward:Dot(flat) < 0) then
if (ground.normal.y > 0.99 or forward:Dot(flat) < 0) then
return vel
else
return Vector3.zero
Expand Down
2 changes: 2 additions & 0 deletions types/Shared/MathUtils.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ export namespace MathUtils {
export function PlayerVecToAngle(this: typeof MathUtils, vec: Vector3): number;

export function LerpAngle(this: typeof MathUtils, a0: number, a1: number, frac: number): number;

export function SmoothLerp<T>(this: typeof MathUtils, a0: T, a1: T, fraction: number, deltaTime: number): T;
}

0 comments on commit c66ca94

Please sign in to comment.