Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions addons/sourcemod/scripting/movementapi/hooks.sp
Original file line number Diff line number Diff line change
Expand Up @@ -622,14 +622,6 @@ public MRESReturn DHooks_OnTryPlayerMove_Post(Address pThis, DHookReturn hReturn

static void NobugLandingOrigin(int client, float landingOrigin[3])
{
// Jump is bugged, try to use the trace result of TryPlayerMove if possible.
if (tryPlayerMoveThisTick && gI_CollisionCount[client] > 0)
{
landingOrigin = gF_TraceEndOrigin[client][0];
return;
}
// Fallback when no collision happened during TryPlayerMove, or that function was not called.

// NOTE: Get ground position and distance to ground.
float groundEndPoint[3];
groundEndPoint = gF_Origin[client];
Expand Down Expand Up @@ -671,7 +663,14 @@ static void NobugLandingOrigin(int client, float landingOrigin[3])
velocity = gF_PostAAVelocity[client];
origin = gF_PostAAOrigin[client];
}


// Jump is bugged, try to use the trace result of TryPlayerMove if possible.
if (tryPlayerMoveThisTick && gI_CollisionCount[client] > 0)
{
landingOrigin = gF_TraceEndOrigin[client][0];
return;
}
// Fallback when no collision happened during TryPlayerMove, or that function was not called.
float firstTraceEndpoint[3], scaledVelocity[3];
scaledVelocity = velocity;
ScaleVector(scaledVelocity, GetTickInterval());
Expand Down