From 2e63ef3299b72111dfa3baebe0480c2e2d3066cf Mon Sep 17 00:00:00 2001 From: Alfred Eriksson Date: Mon, 17 Nov 2008 16:13:12 +0000 Subject: stops recording when client switches state --- src/engine/e_demorec.h | 12 ++++++++++++ src/game/client/gameclient.cpp | 4 ++++ 2 files changed, 16 insertions(+) (limited to 'src') diff --git a/src/engine/e_demorec.h b/src/engine/e_demorec.h index bc54dddd..d73a5a3d 100644 --- a/src/engine/e_demorec.h +++ b/src/engine/e_demorec.h @@ -1,3 +1,10 @@ +/* copyright (c) 2007 magnus auvinen, see licence.txt for more info */ +#ifndef _DEMOREC_H +#define _DEMOREC_H + +#ifdef __cplusplus +extern "C"{ +#endif typedef struct DEMOREC_HEADER { @@ -63,3 +70,8 @@ const DEMOREC_PLAYBACKINFO *demorec_playback_info(); int demorec_isplaying(); int demorec_playback_stop(); +#ifdef __cplusplus +} +#endif + +#endif \ No newline at end of file diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index 74b949d7..11b26053 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -1,4 +1,5 @@ #include +#include #include #include @@ -427,6 +428,9 @@ void GAMECLIENT::on_message(int msgtype) void GAMECLIENT::on_statechange(int new_state, int old_state) { + if(demorec_isrecording()) + demorec_record_stop(); + // reset everything on_reset(); -- cgit 1.4.1