engine: client: ensure demoheader will be written when we're recording demo and changed level

This commit is contained in:
Alibek Omarov 2024-08-14 19:10:00 +03:00
parent ac487a2133
commit 22d3ba674e
2 changed files with 4 additions and 11 deletions

View File

@ -327,10 +327,6 @@ void CL_WriteDemoMessage( qboolean startup, int start, sizebuf_t *msg )
if( !file ) return; if( !file ) return;
// past the start but not recording a demo.
if( !startup && !cls.demorecording )
return;
swlen = MSG_GetNumBytesWritten( msg ) - start; swlen = MSG_GetNumBytesWritten( msg ) - start;
if( swlen <= 0 ) return; if( swlen <= 0 ) return;

View File

@ -2347,14 +2347,11 @@ static void CL_ParseNetMessage( sizebuf_t *msg, void (*parsefn)( sizebuf_t * ))
// after we have parsed the frame // after we have parsed the frame
if( !cls.demoplayback ) if( !cls.demoplayback )
{ {
if( cls.demorecording && !cls.demowaiting ) if( cls.state != ca_active )
{
CL_WriteDemoMessage( false, cls.starting_count, msg );
}
else if( cls.state != ca_active )
{
CL_WriteDemoMessage( true, cls.starting_count, msg ); CL_WriteDemoMessage( true, cls.starting_count, msg );
}
if( cls.demorecording && !cls.demowaiting )
CL_WriteDemoMessage( false, cls.starting_count, msg );
} }
} }