2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2025-01-14 20:40:27 +01:00

engine: client: flush demoheader before copying it

This commit is contained in:
Alibek Omarov 2024-07-04 07:23:48 +03:00
parent efee8149e2
commit fcb463d400

View File

@ -153,12 +153,8 @@ we record a demo on this level
*/
void CL_StartupDemoHeader( void )
{
if( cls.demoheader )
{
FS_Close( cls.demoheader );
}
CL_CloseDemoHeader();
// Note: this is replacing tmpfile()
cls.demoheader = FS_Open( "demoheader.tmp", "w+b", true );
if( !cls.demoheader )
@ -427,6 +423,7 @@ static void CL_WriteDemoHeader( const char *name )
// finish off the startup info.
CL_WriteDemoCmdHeader( dem_stop, cls.demoheader );
FS_Flush( cls.demoheader );
// now copy the stuff we cached from the server.
copysize = savepos = FS_Tell( cls.demoheader );