[MapRotation] Allow people to have empty sv_mapRotation

This commit is contained in:
Diavolo 2022-06-16 18:02:22 +02:00
parent b8bca79c67
commit 4f89102165
No known key found for this signature in database
GPG Key ID: FA77F074E98D98A5

View File

@ -220,18 +220,16 @@ namespace Components
Logger::Print(Game::CON_CHANNEL_SERVER, "Rotating map...\n"); Logger::Print(Game::CON_CHANNEL_SERVER, "Rotating map...\n");
const std::string mapRotation = (*SVMapRotation)->current.string; const std::string mapRotation = (*SVMapRotation)->current.string;
if (mapRotation.empty()) // People may have sv_mapRotation empty because they only use 'addMap' or 'addMap'
if (!mapRotation.empty())
{ {
Logger::Print(Game::CON_CHANNEL_SERVER, "No rotation defined (sv_mapRotation is empty), restarting map.\n"); Logger::DebugInfo("sv_mapRotation is not empty. Parsing...");
RestartCurrentMap();
return;
}
LoadRotation(mapRotation); LoadRotation(mapRotation);
}
if (DedicatedRotation.getEntriesSize() == 0) if (DedicatedRotation.getEntriesSize() == 0)
{ {
Logger::Print(Game::CON_CHANNEL_SERVER, "sv_mapRotation is empty or contains invalid data, restarting map.\n"); Logger::Print(Game::CON_CHANNEL_SERVER, "sv_mapRotation is empty or contains invalid data. Restarting map\n");
RestartCurrentMap(); RestartCurrentMap();
return; return;
} }