From 9adb31df813163446c5e98d55d36f049a353de36 Mon Sep 17 00:00:00 2001 From: sepulzera Date: Fri, 14 Dec 2018 20:09:29 +0100 Subject: [PATCH 1/3] Fix CycleMap end map matches --- src/game/server/gamecontroller.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/game/server/gamecontroller.cpp b/src/game/server/gamecontroller.cpp index b28e5208b..62b7e5c52 100644 --- a/src/game/server/gamecontroller.cpp +++ b/src/game/server/gamecontroller.cpp @@ -747,7 +747,14 @@ void IGameController::Tick() break; case IGS_END_MATCH: // start next match - CycleMap(); + if(m_MatchCount >= m_GameInfo.m_MatchNum-1) + { + CycleMap(); + break; + } + + if(g_Config.m_SvMatchSwap) + GameServer()->SwapTeams(); m_MatchCount++; StartMatch(); break; @@ -903,13 +910,6 @@ void IGameController::CycleMap() if(!str_length(g_Config.m_SvMaprotation)) return; - if(m_MatchCount < m_GameInfo.m_MatchNum-1) - { - if(g_Config.m_SvMatchSwap) - GameServer()->SwapTeams(); - return; - } - // handle maprotation const char *pMapRotation = g_Config.m_SvMaprotation; const char *pCurrentMap = g_Config.m_SvMap; From 82ac68b38f2f25bb4950da7244205c85c9dd1726 Mon Sep 17 00:00:00 2001 From: sepulzera Date: Fri, 14 Dec 2018 20:10:51 +0100 Subject: [PATCH 2/3] Fix change_map command not always changing (close #1841) After applying this commit, the change_map command will work even - when in warmup - when the map is not finished (sv_matches_per_map) --- src/game/server/gamecontroller.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/game/server/gamecontroller.cpp b/src/game/server/gamecontroller.cpp index 62b7e5c52..68a6dafae 100644 --- a/src/game/server/gamecontroller.cpp +++ b/src/game/server/gamecontroller.cpp @@ -892,7 +892,17 @@ static bool IsSeparator(char c) { return c == ';' || c == ' ' || c == ',' || c = void IGameController::ChangeMap(const char *pToMap) { str_copy(m_aMapWish, pToMap, sizeof(m_aMapWish)); + + m_MatchCount = m_GameInfo.m_MatchNum-1; + if(m_GameState == IGS_WARMUP_GAME || m_GameState == IGS_WARMUP_USER) + SetGameState(IGS_GAME_RUNNING); EndMatch(); + + if(m_GameState != IGS_END_MATCH) + { + // game could not been ended, force cycle + CycleMap(); + } } void IGameController::CycleMap() From 742c7ed629e5f3a22c3621385dd651a47cf78bb8 Mon Sep 17 00:00:00 2001 From: sepulzera Date: Sun, 16 Dec 2018 11:41:53 +0100 Subject: [PATCH 3/3] Fix EndMatch without sv_maprotation being set --- src/game/server/gamecontroller.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/game/server/gamecontroller.cpp b/src/game/server/gamecontroller.cpp index 68a6dafae..03d3d1b23 100644 --- a/src/game/server/gamecontroller.cpp +++ b/src/game/server/gamecontroller.cpp @@ -748,10 +748,7 @@ void IGameController::Tick() case IGS_END_MATCH: // start next match if(m_MatchCount >= m_GameInfo.m_MatchNum-1) - { CycleMap(); - break; - } if(g_Config.m_SvMatchSwap) GameServer()->SwapTeams();