From 4f89102165525a9e9ff19cef084a06d9c367503c Mon Sep 17 00:00:00 2001 From: Diavolo Date: Thu, 16 Jun 2022 18:02:22 +0200 Subject: [PATCH] [MapRotation] Allow people to have empty sv_mapRotation --- src/Components/Modules/MapRotation.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Components/Modules/MapRotation.cpp b/src/Components/Modules/MapRotation.cpp index 7de82389..b420832c 100644 --- a/src/Components/Modules/MapRotation.cpp +++ b/src/Components/Modules/MapRotation.cpp @@ -220,18 +220,16 @@ namespace Components Logger::Print(Game::CON_CHANNEL_SERVER, "Rotating map...\n"); 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"); - RestartCurrentMap(); - return; + Logger::DebugInfo("sv_mapRotation is not empty. Parsing..."); + LoadRotation(mapRotation); } - LoadRotation(mapRotation); - 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(); return; }