Skip to content

Commit

Permalink
engine: client: ensure demoheader will be written when we're recordin…
Browse files Browse the repository at this point in the history
…g demo and changed level
  • Loading branch information
a1batross committed Aug 14, 2024
1 parent ac487a2 commit 22d3ba6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
4 changes: 0 additions & 4 deletions engine/client/cl_demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,6 @@ void CL_WriteDemoMessage( qboolean startup, int start, sizebuf_t *msg )

if( !file ) return;

// past the start but not recording a demo.
if( !startup && !cls.demorecording )
return;

swlen = MSG_GetNumBytesWritten( msg ) - start;
if( swlen <= 0 ) return;

Expand Down
9 changes: 3 additions & 6 deletions engine/client/cl_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2347,14 +2347,11 @@ static void CL_ParseNetMessage( sizebuf_t *msg, void (*parsefn)( sizebuf_t * ))
// after we have parsed the frame
if( !cls.demoplayback )
{
if( cls.state != ca_active )
CL_WriteDemoMessage( true, cls.starting_count, msg );

if( cls.demorecording && !cls.demowaiting )
{
CL_WriteDemoMessage( false, cls.starting_count, msg );
}
else if( cls.state != ca_active )
{
CL_WriteDemoMessage( true, cls.starting_count, msg );
}
}
}

Expand Down

0 comments on commit 22d3ba6

Please sign in to comment.