summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2018-09-16 17:11:36 +0200
committeroy <Tom_Adams@web.de>2018-09-16 17:11:36 +0200
commitd4f314702425618c385bf890ec92e2c070c9f37e (patch)
tree14f7a78fba65abec17fe96d178d385cbb6a064f1
parent439483cef207f3e09f453c3406343a21eff7ba68 (diff)
unpause the game when all players left
-rw-r--r--src/game/server/gamecontext.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp
index 897e34837..f459bfd3a 100644
--- a/src/game/server/gamecontext.cpp
+++ b/src/game/server/gamecontext.cpp
@@ -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)