From 8cf997d9cfaad29f15613fd7e1cdb4fdcbbb8e9b Mon Sep 17 00:00:00 2001 From: "auria.mg" Date: Mon, 8 Oct 2018 20:55:17 -0400 Subject: [PATCH] WIP fix for #3462 . Not merged yet since this has side-effects, can cause issues on tracks like lighthouse where you can drive around the lapline --- src/tracks/check_lap.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tracks/check_lap.cpp b/src/tracks/check_lap.cpp index e7274c8d9..9b2c9394d 100644 --- a/src/tracks/check_lap.cpp +++ b/src/tracks/check_lap.cpp @@ -69,6 +69,11 @@ bool CheckLap::isTriggered(const Vec3 &old_pos, const Vec3 &new_pos, // has check defined. if(!lin_world) return false; + + // Cannot cross lap when off-road, since we are not sure where the kart is + if (!lin_world->isOnRoad(kart_index)) + return false; + float current_distance = lin_world->getDistanceDownTrackForKart(kart_index, false); bool result = (m_previous_distance[kart_index]>0.95f*track_length && current_distance<7.0f);