From 7484e710e7d64554e493de4ed7e549b2f9938c59 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Wed, 9 Aug 2023 14:08:59 +0900 Subject: [PATCH] Fix missing "break" in collision success --- src/screen_trunner.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/screen_trunner.cc b/src/screen_trunner.cc index 72e60a0..ec02c95 100644 --- a/src/screen_trunner.cc +++ b/src/screen_trunner.cc @@ -263,9 +263,11 @@ bool TRunnerScreen::update(float dt) { if (auto collision = GetRayCollisionTriangle(ray, nw, sw, ne); collision.hit) { on_collide_fn(collision.point); + break; } else if (auto collision = GetRayCollisionTriangle(ray, ne, sw, se); collision.hit) { on_collide_fn(collision.point); + break; } } }