diff --git a/src/modes/world.cpp b/src/modes/world.cpp index b8c761b43..ea6f8a981 100644 --- a/src/modes/world.cpp +++ b/src/modes/world.cpp @@ -199,6 +199,14 @@ void World::init() // This also defines the static Track::getCurrentTrack function. track->loadTrackModel(race_manager->getReverseTrack()); + // Shuffles the start transforms with playing 3-strikes or free for all battles. + if ((race_manager->getMinorMode() == RaceManager::MINOR_MODE_3_STRIKES || + race_manager->getMinorMode() == RaceManager::MINOR_MODE_FREE_FOR_ALL) && + !NetworkConfig::get()->isNetworking()) + { + track->shuffleStartTransforms(); + } + main_loop->renderGUI(6998); if (gk > 0) { diff --git a/src/tracks/track.hpp b/src/tracks/track.hpp index b8e4ab9f9..4cb71c107 100644 --- a/src/tracks/track.hpp +++ b/src/tracks/track.hpp @@ -28,6 +28,7 @@ #include #include +#include #include @@ -517,6 +518,13 @@ public: return m_start_transforms[index]; } // ------------------------------------------------------------------------ + /** Shuffles the start transformations + */ + void shuffleStartTransforms() + { + std::random_shuffle(m_start_transforms.begin(), m_start_transforms.end()); + } + // ------------------------------------------------------------------------ /** Sets pointer to the aabb of this track. */ void getAABB(const Vec3 **min, const Vec3 **max) const { *min = &m_aabb_min; *max = &m_aabb_max; }