From 2e24cf4dcf2093d0100e99787941f97b595b0e76 Mon Sep 17 00:00:00 2001 From: Alfredo Tupone Date: Sun, 28 Apr 2024 19:06:57 +0200 Subject: [PATCH] Avoid a div by 0 --- src/game/Intersect.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/Intersect.cxx b/src/game/Intersect.cxx index 099d600047..3f75ff6c83 100644 --- a/src/game/Intersect.cxx +++ b/src/game/Intersect.cxx @@ -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