diff --git a/src/modes/tutorial_world.cpp b/src/modes/tutorial_world.cpp index 8bf0eec48..27def25a0 100644 --- a/src/modes/tutorial_world.cpp +++ b/src/modes/tutorial_world.cpp @@ -26,3 +26,29 @@ TutorialWorld::TutorialWorld() { m_stop_music_when_dialog_open = false; } // TutorialWorld + +unsigned int TutorialWorld::getRescuePositionIndex(AbstractKart *kart) +{ + const int start_spots_amount = getTrack()->getNumberOfStartPositions(); + assert(start_spots_amount > 0); + + float closest_distance = 999999.0f; + int closest_id_found = 0; + + Vec3 kart_pos = kart->getFrontXYZ(); + + for (int n = 0; n