Skip to content

Commit

Permalink
unpause the game when all players left
Browse files Browse the repository at this point in the history
  • Loading branch information
oy committed Sep 16, 2018
1 parent 439483c commit d4f3147
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/game/server/gamecontext.cpp
Expand Up @@ -590,6 +590,14 @@ void CGameContext::OnClientDrop(int ClientID, const char *pReason)
if(m_apPlayers[i] && m_apPlayers[i]->m_SpectatorID == ClientID)
m_apPlayers[i]->m_SpectatorID = SPEC_FREEVIEW;
}

// check if all players left and game is paused => unpause
for (int i = 0; i < MAX_CLIENTS; ++i)
{
if(m_apPlayers[i] && m_apPlayers[i]->GetTeam() != TEAM_SPECTATORS)
return;
}
m_pController->TogglePause();
}

void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID)
Expand Down

0 comments on commit d4f3147

Please sign in to comment.