Skip to content

Commit

Permalink
Avoid a div by 0
Browse files Browse the repository at this point in the history
  • Loading branch information
atupone committed Apr 28, 2024
1 parent 9e9f986 commit 2e24cf4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/game/Intersect.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,8 @@ static float timeRayHitsPlane(const float pb[3], const float db[3],
for (i = 0; i < 3; i++)
velocity += n[i] * db[i];

// if velocity is greater than 0 no way to trespass the plane
if (velocity > 0.0f)
// if velocity is greater or equal than 0 no way to trespass the plane
if (velocity >= 0.0f)
return -1.0f;

// time is ... that is normalized
Expand Down

0 comments on commit 2e24cf4

Please sign in to comment.