From 6e347ae51767952a80980c33bdb236708d1594dc Mon Sep 17 00:00:00 2001 From: Benau Date: Thu, 27 Jan 2022 07:18:45 +0800 Subject: [PATCH] Fix #4726 --- src/graphics/camera_end.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/graphics/camera_end.cpp b/src/graphics/camera_end.cpp index c97f3dc48..d98a8ca7e 100644 --- a/src/graphics/camera_end.cpp +++ b/src/graphics/camera_end.cpp @@ -36,6 +36,7 @@ CameraEnd::CameraEnd(int camera_index, AbstractKart* kart) m_current_end_camera = 0; if (m_end_cameras.size() > 1) { + bool found = false; for (unsigned i = 0; i < m_end_cameras.size(); i++) { if (m_end_cameras[i].isReached(kart->getSmoothedXYZ())) @@ -45,9 +46,12 @@ CameraEnd::CameraEnd(int camera_index, AbstractKart* kart) m_next_end_camera = i + 1; if (m_next_end_camera >= (unsigned)m_end_cameras.size()) m_next_end_camera = 0; + found = true; break; } } + if (!found) + m_next_end_camera = 1; } else m_next_end_camera = 0;