[MapRotation] Fix SVRandomMapRotation

This commit is contained in:
Diavolo 2022-06-16 18:19:51 +02:00
parent 4f89102165
commit d7e9ff19ee
No known key found for this signature in database
GPG Key ID: FA77F074E98D98A5
2 changed files with 16 additions and 7 deletions

View File

@ -109,13 +109,6 @@ namespace Components
Logger::DebugInfo("DedicatedRotation size after parsing is '{}'\n", DedicatedRotation.getEntriesSize()); Logger::DebugInfo("DedicatedRotation size after parsing is '{}'\n", DedicatedRotation.getEntriesSize());
// Shuffles values
if (SVRandomMapRotation.get<bool>())
{
Logger::Print(Game::CON_CHANNEL_SERVER, "Randomizing the map rotation\n");
DedicatedRotation.randomize();
}
loaded = true; loaded = true;
} }
@ -210,6 +203,19 @@ namespace Components
} }
} }
void MapRotation::RandomizeMapRotation()
{
if (SVRandomMapRotation.get<bool>())
{
Logger::Print(Game::CON_CHANNEL_SERVER, "Randomizing the map rotation\n");
DedicatedRotation.randomize();
}
else
{
Logger::DebugInfo("Map rotation was not randomized");
}
}
void MapRotation::SV_MapRotate_f() void MapRotation::SV_MapRotate_f()
{ {
if (!ShouldRotate()) if (!ShouldRotate())
@ -234,6 +240,8 @@ namespace Components
return; return;
} }
RandomizeMapRotation();
ApplyMapRotation(); ApplyMapRotation();
} }

View File

@ -60,6 +60,7 @@ namespace Components
static bool ShouldRotate(); static bool ShouldRotate();
static void RestartCurrentMap(); static void RestartCurrentMap();
static void ApplyMapRotation(); static void ApplyMapRotation();
static void RandomizeMapRotation();
static void SV_MapRotate_f(); static void SV_MapRotate_f();
}; };