From b78a1e6ea32a7cfc45aef7e0abe97d79925f56a5 Mon Sep 17 00:00:00 2001 From: g-cont Date: Wed, 10 Oct 2018 00:00:00 +0300 Subject: [PATCH] 10 Oct 2018 --- engine/client/cl_demo.c | 9 ++++++++- engine/client/s_main.c | 2 +- engine/common/filesystem.c | 15 +++++++++++++++ engine/common/host.c | 4 ++-- 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/engine/client/cl_demo.c b/engine/client/cl_demo.c index 6fc90501..fdcfaf73 100644 --- a/engine/client/cl_demo.c +++ b/engine/client/cl_demo.c @@ -725,7 +725,7 @@ void CL_DemoCompleted( void ) CL_StopPlayback(); - if( !CL_NextDemo() && host_developer.value <= DEV_NONE ) + if( !CL_NextDemo() && !cls.changedemo ) UI_SetActiveMenu( true ); Cvar_SetValue( "v_dark", 0.0f ); @@ -795,6 +795,7 @@ qboolean CL_ReadRawNetworkData( byte *buffer, size_t *length ) } } + cls.netchan.last_received = host.realtime; cls.netchan.total_received += msglen; *length = msglen; @@ -888,6 +889,7 @@ qboolean CL_DemoReadMessageQuake( byte *buffer, size_t *length ) } } + cls.netchan.last_received = host.realtime; cls.netchan.total_received += msglen; *length = msglen; @@ -1312,6 +1314,7 @@ void CL_CheckStartupDemos( void ) // run demos loop in background mode Cvar_SetValue( "v_dark", 1.0f ); + cls.demos_pending = false; cls.demonum = 0; CL_NextDemo (); } @@ -1594,6 +1597,10 @@ Return to looping demos */ void CL_Demos_f( void ) { + // demos is starting up... + if( cls.demos_pending ) + return; + if( cls.key_dest != key_menu ) { Con_Printf( "'demos' is not valid from the console\n" ); diff --git a/engine/client/s_main.c b/engine/client/s_main.c index be4cbcbc..e210b845 100644 --- a/engine/client/s_main.c +++ b/engine/client/s_main.c @@ -2101,7 +2101,7 @@ void S_Play2_f( void ) if( Cmd_Argc() == 1 ) { - Con_Printf( S_USAGE "play \n" ); + Con_Printf( S_USAGE "play2 \n" ); return; } diff --git a/engine/common/filesystem.c b/engine/common/filesystem.c index e9aaf7f1..84aac294 100644 --- a/engine/common/filesystem.c +++ b/engine/common/filesystem.c @@ -788,6 +788,8 @@ assume GameInfo is valid static void FS_WriteGameInfo( const char *filepath, gameinfo_t *GameInfo ) { file_t *f = FS_Open( filepath, "w", false ); // we in binary-mode + int i, write_ambients = false; + if( !f ) Sys_Error( "FS_WriteGameInfo: can't write %s\n", filepath ); // may be disk-space is out? FS_Print( f, "// generated by Xash3D\n\n\n" ); @@ -862,6 +864,19 @@ static void FS_WriteGameInfo( const char *filepath, gameinfo_t *GameInfo ) if( GameInfo->max_particles > 0 ) FS_Printf( f, "max_particles\t%i\n", GameInfo->max_particles ); + for( i = 0; i < NUM_AMBIENTS; i++ ) + { + if( *GameInfo->ambientsound[i] ) + { + if( !write_ambients ) + { + FS_Print( f, "\n" ); + write_ambients = true; + } + FS_Printf( f, "ambient%i\t\t%s\n", i, GameInfo->ambientsound[i] ); + } + } + FS_Print( f, "\n\n\n" ); FS_Close( f ); // all done } diff --git a/engine/common/host.c b/engine/common/host.c index 3f3f7630..ec4ed388 100644 --- a/engine/common/host.c +++ b/engine/common/host.c @@ -418,7 +418,7 @@ double Host_CalcFPS( void ) if( host.type != HOST_DEDICATED && Host_IsLocalGame( ) && !CL_IsTimeDemo( )) { // ajdust fps for vertical synchronization - if( gl_vsync != NULL && gl_vsync->value ) + if( CVAR_TO_BOOL( gl_vsync )) { if( vid_displayfrequency->value != 0.0f ) fps = vid_displayfrequency->value; @@ -683,7 +683,7 @@ void Host_InitCommon( const char *hostname, qboolean bChangeGame ) host.con_showalways = true; // we can specified custom name, from Sys_NewInstance - if( GetModuleFileName( NULL, szTemp, sizeof( szTemp )) && !host.change_game ) + if( GetModuleFileName( NULL, szTemp, sizeof( szTemp ))) COM_FileBase( szTemp, SI.exeName ); COM_ExtractFilePath( szTemp, szRootPath );