stops recording when client switches state

This commit is contained in:
Alfred Eriksson 2008-11-17 16:13:12 +00:00
parent 4b053322f3
commit 2e63ef3299
2 changed files with 16 additions and 0 deletions

View file

@ -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

View file

@ -1,4 +1,5 @@
#include <engine/e_client_interface.h>
#include <engine/e_demorec.h>
#include <game/generated/g_protocol.hpp>
#include <game/generated/gc_data.hpp>
@ -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();