mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38:18 +00:00
swap teamscore when swapping teams. closes #2004
This commit is contained in:
parent
8c544e6e7c
commit
a1b8926f51
|
@ -446,6 +446,8 @@ void CGameContext::SwapTeams()
|
||||||
if(m_apPlayers[i] && m_apPlayers[i]->GetTeam() != TEAM_SPECTATORS)
|
if(m_apPlayers[i] && m_apPlayers[i]->GetTeam() != TEAM_SPECTATORS)
|
||||||
m_pController->DoTeamChange(m_apPlayers[i], m_apPlayers[i]->GetTeam()^1, false);
|
m_pController->DoTeamChange(m_apPlayers[i], m_apPlayers[i]->GetTeam()^1, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_pController->SwapTeamscore();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGameContext::OnTick()
|
void CGameContext::OnTick()
|
||||||
|
|
|
@ -657,6 +657,16 @@ void IGameController::StartRound()
|
||||||
SetGameState(IGS_WARMUP_GAME, TIMER_INFINITE);
|
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
|
// general
|
||||||
void IGameController::Snap(int SnappingClient)
|
void IGameController::Snap(int SnappingClient)
|
||||||
{
|
{
|
||||||
|
|
|
@ -181,6 +181,7 @@ public:
|
||||||
else
|
else
|
||||||
SetGameState(IGS_WARMUP_USER, Seconds);
|
SetGameState(IGS_WARMUP_USER, Seconds);
|
||||||
}
|
}
|
||||||
|
void SwapTeamscore();
|
||||||
|
|
||||||
// general
|
// general
|
||||||
virtual void Snap(int SnappingClient);
|
virtual void Snap(int SnappingClient);
|
||||||
|
|
Loading…
Reference in a new issue