diff options
| author | oy <Tom_Adams@web.de> | 2010-12-12 16:48:13 +0100 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2010-12-12 16:48:13 +0100 |
| commit | c75a75b64ff804e7a14374e17b31377aabff0d63 (patch) | |
| tree | 0b49986e39b44ae0b1f4673753a712779723813d /src/game/client/gameclient.cpp | |
| parent | b4c007778cab749e9d163baec64d22349435ea3f (diff) | |
| download | zcatch-c75a75b64ff804e7a14374e17b31377aabff0d63.tar.gz zcatch-c75a75b64ff804e7a14374e17b31377aabff0d63.zip | |
made it possible to automatically take game over screenshots. Closes #339
Diffstat (limited to 'src/game/client/gameclient.cpp')
| -rw-r--r-- | src/game/client/gameclient.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index 08459abc..4696bdcd 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -584,6 +584,12 @@ void CGameClient::OnStateChange(int NewState, int OldState) void CGameClient::OnShutdown() {} void CGameClient::OnEnterGame() {} +void CGameClient::OnGameOver() +{ + if(Client()->State() != IClient::STATE_DEMOPLAYBACK) + Client()->AutoScreenshot_Start(); +} + void CGameClient::OnRconLine(const char *pLine) { m_pGameConsole->PrintLine(CGameConsole::CONSOLETYPE_REMOTE, pLine); @@ -769,7 +775,13 @@ void CGameClient::OnNewSnapshot() } } else if(Item.m_Type == NETOBJTYPE_GAME) + { + static int s_GameOver = 0; m_Snap.m_pGameobj = (CNetObj_Game *)pData; + if(s_GameOver == 0 && m_Snap.m_pGameobj->m_GameOver != 0) + OnGameOver(); + s_GameOver = m_Snap.m_pGameobj->m_GameOver; + } else if(Item.m_Type == NETOBJTYPE_FLAG) m_Snap.m_paFlags[Item.m_Id%2] = (const CNetObj_Flag *)pData; } |