Cleanup if nesting

This commit is contained in:
ChillerDragon 2019-04-06 17:22:15 +02:00
parent ce5a7ea626
commit 905204781b

View file

@ -36,18 +36,19 @@ void CGameTeams::OnCharacterStart(int ClientID)
{
pStartingChar->m_DDRaceState = DDRACE_STARTED;
pStartingChar->m_StartTime = Tick;
return;
}
else
{
bool Waiting = false;
for(int i = 0; i < MAX_CLIENTS; ++i)
{
if (m_Core.Team(ClientID) == m_Core.Team(i))
{
if(m_Core.Team(ClientID) != m_Core.Team(i))
continue;
CPlayer* pPlayer = GetPlayer(i);
if (pPlayer && pPlayer->IsPlaying()
&& GetDDRaceState(pPlayer) == DDRACE_FINISHED)
{
if(!pPlayer || !pPlayer->IsPlaying())
continue;
if(GetDDRaceState(pPlayer) != DDRACE_FINISHED)
continue;
Waiting = true;
pStartingChar->m_DDRaceState = DDRACE_NONE;
@ -76,8 +77,6 @@ void CGameTeams::OnCharacterStart(int ClientID)
m_LastChat[i] = Tick;
}
}
}
}
if(m_TeamState[m_Core.Team(ClientID)] < TEAMSTATE_STARTED && !Waiting)
{
@ -127,7 +126,6 @@ void CGameTeams::OnCharacterStart(int ClientID)
}
}
}
}
void CGameTeams::OnCharacterFinish(int ClientID)
{