Skip to content

Commit

Permalink
zzre: Fix world raycasts returning hits after maxDistance
Browse files Browse the repository at this point in the history
Causing forced jumps on the ropes in Dunmore to not trigger
  • Loading branch information
Helco committed Mar 12, 2024
1 parent 9fc2439 commit 400462d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion zzre.core/collider/WorldCollider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ public WorldTriangleInfo GetTriangleInfo(WorldTriangleId id) =>
return null;
}

return RaycastSection(rootSection, ray, minDist: 0f, maxLength, prevHit: null);
var fine = RaycastSection(rootSection, ray, minDist: 0f, maxLength, prevHit: null);
if (fine is not null && fine.Value.Distance > maxLength)
return null;
return fine;
}

private Raycast? RaycastSection(Section section, Ray ray, float minDist, float maxDist, Raycast? prevHit)
Expand Down

0 comments on commit 400462d

Please sign in to comment.