Randomizing spawn points for battle mode ()

* Changed to randomize spawns for battle modes

* Changed to randomize spawns for battle modes

* Randomizing spawns only considers offline play

* Code cleanup, removed unused spawn_id from RemoteKartInfo

* Changed to shuffle the start transforms instead of randomizing spawn ids

* Removed unused function randomizeSpawn()

* Updated offline check for shuffle start transforms

* Cleanup removed newlines in race_manager.cpp
This commit is contained in:
Alexander Mennborg 2019-10-14 19:19:31 +02:00 committed by Benau
parent 76871a3f24
commit fc9aff80dd
2 changed files with 16 additions and 0 deletions
src

@ -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)
{

@ -28,6 +28,7 @@
#include <string>
#include <vector>
#include <algorithm>
#include <irrlicht.h>
@ -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; }