Added fs_restart command
diff --git a/src/engine/client/clientGame.cpp b/src/engine/client/clientGame.cpp
index 8a46890..cfcc94f 100644
--- a/src/engine/client/clientGame.cpp
+++ b/src/engine/client/clientGame.cpp
@@ -488,7 +488,7 @@ bool idClientGameSystemLocal::GetServerCommand( sint serverCommandNumber )
{
Com_Printf( "%i: %s\n", i, clc.reliableCommands[i] );
}
-
+
i++;
}
diff --git a/src/engine/framework/FileSystem.cpp b/src/engine/framework/FileSystem.cpp
index d429722..89eeaf6 100644
--- a/src/engine/framework/FileSystem.cpp
+++ b/src/engine/framework/FileSystem.cpp
@@ -3931,6 +3931,11 @@ void idFileSystemLocal::Shutdown( bool closemfp )
{
fclose( missingFiles );
}
+
+ if( closemfp )
+ {
+ cmdSystem->RemoveCommand( "fs_restart" );
+ }
}
/*
@@ -4552,6 +4557,16 @@ void idFileSystemLocal::InitFilesystem( void )
Q_strncpyz( lastValidGame, fs_gamedirvar->string, sizeof( lastValidGame ) );
}
+/*
+=================
+FS_Restart_f
+Console command to restart filesystem.
+=================
+*/
+void idFileSystemLocal::Restart_f( void )
+{
+ fileSystemLocal.Restart( fs_checksumFeed );
+}
/*
================
@@ -4569,6 +4584,8 @@ void idFileSystemLocal::Restart( sint checksumFeed )
// clear pak references
ClearPakReferences( 0 );
+ cmdSystem->AddCommand( "fs_restart", Restart_f, "Restarts the filesystem" );
+
// try to start up normally
Startup( BASEGAME );
diff --git a/src/engine/framework/FileSystem.hpp b/src/engine/framework/FileSystem.hpp
index 67701ce..c492f17 100644
--- a/src/engine/framework/FileSystem.hpp
+++ b/src/engine/framework/FileSystem.hpp
@@ -254,6 +254,8 @@ public:
virtual pointer GetGameDir( void );
virtual bool IsFileEmpty( valueType* filename );
virtual valueType* GetFullGamePath( valueType* filename );
+
+ static void Restart_f( void );
};
extern idFileSystemLocal fileSystemLocal;
GitHub
sha: 4aa38449