From 8a93b07c5efeb8dc6af5eace4a10ad5db6afa32f Mon Sep 17 00:00:00 2001 From: Benau Date: Fri, 29 Dec 2017 23:26:29 +0800 Subject: [PATCH] Don't clean the current skidmarking --- src/graphics/skid_marks.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/graphics/skid_marks.cpp b/src/graphics/skid_marks.cpp index 92b073b59..cf7a67195 100644 --- a/src/graphics/skid_marks.cpp +++ b/src/graphics/skid_marks.cpp @@ -81,9 +81,11 @@ void SkidMarks::update(float dt, bool force_skid_marks, float f = dt / stk_config->m_skid_fadeout_time; auto it = m_left.begin(); + // Don't clean the current skidmarking while (it != m_left.end()) { - if ((*it)->fade(f)) + if ((it + 1 != m_left.end() || !m_skid_marking) + && (*it)->fade(f)) { it = m_left.erase(it); continue; @@ -93,7 +95,8 @@ void SkidMarks::update(float dt, bool force_skid_marks, it = m_right.begin(); while (it != m_right.end()) { - if ((*it)->fade(f)) + if ((it + 1 != m_right.end() || !m_skid_marking) + && (*it)->fade(f)) { it = m_right.erase(it); continue;