about summary refs log tree commit diff
path: root/src/game/client
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2011-01-06 23:21:51 +0100
committeroy <Tom_Adams@web.de>2011-01-06 23:21:51 +0100
commit41b8022aa1a941a4b2f3095dd4f8600daf4cd168 (patch)
tree5f6a37072c430f280f99de419e8fb1f27c2b496a /src/game/client
parenteedaf62d97d1100bc4bd3dda50bfcd0c3763e812 (diff)
downloadzcatch-41b8022aa1a941a4b2f3095dd4f8600daf4cd168.tar.gz
zcatch-41b8022aa1a941a4b2f3095dd4f8600daf4cd168.zip
record a new demo when a game ends. Closes #358
Diffstat (limited to 'src/game/client')
-rw-r--r--src/game/client/gameclient.cpp8
-rw-r--r--src/game/client/gameclient.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp
index 45bd7ae3..2bebf486 100644
--- a/src/game/client/gameclient.cpp
+++ b/src/game/client/gameclient.cpp
@@ -591,6 +591,12 @@ void CGameClient::OnGameOver()
 		Client()->AutoScreenshot_Start();
 }
 
+void CGameClient::OnStartGame()
+{
+	if(Client()->State() != IClient::STATE_DEMOPLAYBACK)
+		Client()->DemoRecorder_HandleAutoStart();
+}
+
 void CGameClient::OnRconLine(const char *pLine)
 {
 	m_pGameConsole->PrintLine(CGameConsole::CONSOLETYPE_REMOTE, pLine);
@@ -781,6 +787,8 @@ void CGameClient::OnNewSnapshot()
 				m_Snap.m_pGameobj = (CNetObj_Game *)pData;
 				if(s_GameOver == 0 && m_Snap.m_pGameobj->m_GameOver != 0)
 					OnGameOver();
+				else if(s_GameOver != 0 && m_Snap.m_pGameobj->m_GameOver == 0)
+					OnStartGame();
 				s_GameOver = m_Snap.m_pGameobj->m_GameOver;
 			}
 			else if(Item.m_Type == NETOBJTYPE_FLAG)
diff --git a/src/game/client/gameclient.h b/src/game/client/gameclient.h
index 5ee2c989..99e64028 100644
--- a/src/game/client/gameclient.h
+++ b/src/game/client/gameclient.h
@@ -181,6 +181,7 @@ public:
 	virtual void OnEnterGame();
 	virtual void OnRconLine(const char *pLine);
 	virtual void OnGameOver();
+	virtual void OnStartGame();
 	
 	virtual const char *GetItemName(int Type);
 	virtual const char *Version();