diff options
-rw-r--r-- | source/cl_demo.c | 3 | ||||
-rw-r--r-- | source/cl_main.c | 17 | ||||
-rw-r--r-- | source/cl_null.c | 4 | ||||
-rw-r--r-- | source/com_local.h | 1 | ||||
-rw-r--r-- | source/cvar.c | 6 | ||||
-rw-r--r-- | source/files.c | 19 | ||||
-rw-r--r-- | source/sv_init.c | 3 |
7 files changed, 28 insertions, 25 deletions
diff --git a/source/cl_demo.c b/source/cl_demo.c index 0b006d2..c196054 100644 --- a/source/cl_demo.c +++ b/source/cl_demo.c @@ -415,7 +415,7 @@ CL_PlayDemo_f static void CL_PlayDemo_f( void ) { char name[MAX_OSPATH]; fileHandle_t demofile; - char *arg, *ext; + char *arg; int length; if( Cmd_Argc() < 2 ) { @@ -427,7 +427,6 @@ static void CL_PlayDemo_f( void ) { length = 0; arg = Cmd_Argv( 1 ); - if( arg[0] == '/' ) { // Assume full path is given Q_strncpyz( name, arg + 1, sizeof( name ) ); diff --git a/source/cl_main.c b/source/cl_main.c index 605ad80..13d6dda 100644 --- a/source/cl_main.c +++ b/source/cl_main.c @@ -2171,22 +2171,6 @@ void CL_LocalConnect( void ) { } } -/* -============ -CL_RestartFilesystem_f - -Console command to re-start the file system. -============ -*/ -static void CL_RestartFilesystem_f( void ) { - if( !FS_SafeToRestart() ) { - Com_Printf( "Can't \"%s\", there are some open file handles.\n", Cmd_Argv( 0 ) ); - return; - } - - CL_RestartFilesystem(); -} - static void cl_gun_changed( cvar_t *self ) { CL_UpdateGunSetting(); } @@ -2251,7 +2235,6 @@ static const cmdreg_t c_client[] = { { "dumpstatusbar", CL_DumpStatusbar_f }, { "dumplayout", CL_DumpLayout_f }, { "vid_restart", CL_RestartRefresh_f }, - { "fs_restart", CL_RestartFilesystem_f }, // // forward to server commands diff --git a/source/cl_null.c b/source/cl_null.c index a8dfd06..62df58a 100644 --- a/source/cl_null.c +++ b/source/cl_null.c @@ -79,6 +79,10 @@ void SCR_BeginLoadingPlaque( void ) { void SCR_EndLoadingPlaque( void ) { } +void CL_RestartFilesystem( void ) { + FS_Restart(); +} + void CL_LocalConnect( void ) { if( FS_NeedRestart() ) { FS_Restart(); diff --git a/source/com_local.h b/source/com_local.h index 0f44044..a06af3d 100644 --- a/source/com_local.h +++ b/source/com_local.h @@ -1045,6 +1045,7 @@ void Con_SetMaxHeight( float frac ); void SCR_BeginLoadingPlaque (void); void SCR_ModeChanged( void ); void CL_LocalConnect( void ); +void CL_RestartFilesystem( void ); void CL_InputFrame( void ); void CL_AppActivate( qboolean active ); void CL_UpdateUserinfo( cvar_t *var, cvarSetSource_t source ); diff --git a/source/cvar.c b/source/cvar.c index 022c3c0..352c8c2 100644 --- a/source/cvar.c +++ b/source/cvar.c @@ -224,7 +224,7 @@ cvar_t *Cvar_Get( const char *var_name, const char *var_value, int flags ) { if( !( flags & CVAR_USER_CREATED ) ) { if( var->flags & CVAR_USER_CREATED ) { - /* update default string if cvar was set from command line */ + // update default string if cvar was set from command line Z_Free( var->defaultString ); var->defaultString = Cvar_CopyString( var_value ); var->flags &= ~CVAR_USER_CREATED; @@ -237,6 +237,7 @@ cvar_t *Cvar_Get( const char *var_name, const char *var_value, int flags ) { var->flags |= CVAR_DEFAULTS_MIXED; } } +#if 0 if( ( var->flags & CVAR_LATCHED ) && !( flags & CVAR_LATCHED ) ) { if( var->latched_string ) { Z_Free( var->latched_string ); @@ -244,6 +245,7 @@ cvar_t *Cvar_Get( const char *var_name, const char *var_value, int flags ) { } var->flags &= ~CVAR_LATCHED; } +#endif } else { flags &= ~CVAR_USER_CREATED; } @@ -252,7 +254,7 @@ cvar_t *Cvar_Get( const char *var_name, const char *var_value, int flags ) { return var; } - /* once allocated, cvar name is never changed */ + // once allocated, cvar name is never changed length = strlen( var_name ) + 1; var = Cvar_Malloc( sizeof( *var ) + length ); var->name = ( char * )( var + 1 ); diff --git a/source/files.c b/source/files.c index 046cae7..4d51721 100644 --- a/source/files.c +++ b/source/files.c @@ -2466,7 +2466,7 @@ qboolean FS_SafeToRestart( void ) { fsFile_t *file; int i; - /* make sure no files are opened for reading */ + // make sure no files are opened for reading for( i = 0, file = fs_files; i < MAX_FILE_HANDLES; i++, file++ ) { if( file->type == FS_FREE ) { continue; @@ -2531,6 +2531,22 @@ void FS_Restart( void ) { } /* +============ +FS_Restart_f + +Console command to re-start the file system. +============ +*/ +static void FS_Restart_f( void ) { + if( !FS_SafeToRestart() ) { + Com_Printf( "Can't \"%s\", there are some open file handles.\n", Cmd_Argv( 0 ) ); + return; + } + + CL_RestartFilesystem(); +} + +/* ================ FS_FillAPI ================ @@ -2559,6 +2575,7 @@ static const cmdreg_t c_fs[] = { { "whereis", FS_WhereIs_f }, { "link", FS_Link_f, FS_Link_g }, { "unlink", FS_UnLink_f, FS_Link_g }, + { "fs_restart", FS_Restart_f }, { NULL } }; diff --git a/source/sv_init.c b/source/sv_init.c index 62e91cd..eb65e3a 100644 --- a/source/sv_init.c +++ b/source/sv_init.c @@ -24,9 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. server_static_t svs; // persistant server info server_t sv; // local server -byte sv_multicast_buffer[MAX_MSGLEN]; - - void SV_ClientReset( client_t *client ) { if( client->state < cs_connected ) { return; |