diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index 52a0767ce..05a49cef5 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -446,6 +446,8 @@ void CGameContext::SwapTeams() if(m_apPlayers[i] && m_apPlayers[i]->GetTeam() != TEAM_SPECTATORS) m_pController->DoTeamChange(m_apPlayers[i], m_apPlayers[i]->GetTeam()^1, false); } + + m_pController->SwapTeamscore(); } void CGameContext::OnTick() diff --git a/src/game/server/gamecontroller.cpp b/src/game/server/gamecontroller.cpp index be892a600..6be15c34b 100644 --- a/src/game/server/gamecontroller.cpp +++ b/src/game/server/gamecontroller.cpp @@ -657,6 +657,16 @@ void IGameController::StartRound() SetGameState(IGS_WARMUP_GAME, TIMER_INFINITE); } +void IGameController::SwapTeamscore() +{ + if(!IsTeamplay()) + return; + + int Score = m_aTeamscore[TEAM_RED]; + m_aTeamscore[TEAM_RED] = m_aTeamscore[TEAM_BLUE]; + m_aTeamscore[TEAM_BLUE] = Score; +} + // general void IGameController::Snap(int SnappingClient) { diff --git a/src/game/server/gamecontroller.h b/src/game/server/gamecontroller.h index bd8be25f2..54004961d 100644 --- a/src/game/server/gamecontroller.h +++ b/src/game/server/gamecontroller.h @@ -181,6 +181,7 @@ public: else SetGameState(IGS_WARMUP_USER, Seconds); } + void SwapTeamscore(); // general virtual void Snap(int SnappingClient);