mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
stops recording when client switches state
This commit is contained in:
parent
4b053322f3
commit
2e63ef3299
|
@ -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
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue