diff --git a/Changelog.md b/Changelog.md index b4dfbe20..459d26c3 100644 --- a/Changelog.md +++ b/Changelog.md @@ -22,6 +22,7 @@ Note: Numbers starting with a "#" like #330 refer to the bugreport with that num (setting it to `1` worked around the bug; #632) * Updated Dear ImGui to 1.91.4 * Fix scaling of Grabber cursor in Resurrection of Evil in non-4:3 resolutions (#637) +* Add `com_disableAutoSaves` CVar: If set to `1`, Autosaves (when starting a level) are disabled (#620) 1.5.4 (2024-08-03) ------------------------------------------------------------------------ diff --git a/Configuration.md b/Configuration.md index 78410b4f..ed6e9b6f 100644 --- a/Configuration.md +++ b/Configuration.md @@ -179,6 +179,11 @@ This can be configured with the following CVars: ## Other CVars added in dhewm3 +- `com_disableAutoSaves` if set to `1`, no Autosaves are created when starting a level, and when + restarting a level no attempt to load one will be made. Defaults to `0` (Autosaves *are* created) +- `com_numQuicksaves` how many Quicksaves to keep - when creating a Quicksave, the oldest one gets + overwritten. Defaults to `4` + - `g_hitEffect` if set to `1` (the default), mess up player camera when taking damage. Set to `0` if you don't like that effect. diff --git a/neo/framework/Session.cpp b/neo/framework/Session.cpp index 184a90ee..65f205e8 100644 --- a/neo/framework/Session.cpp +++ b/neo/framework/Session.cpp @@ -60,6 +60,8 @@ idCVar idSessionLocal::com_guid( "com_guid", "", CVAR_SYSTEM | CVAR_ARCHIVE | CV idCVar idSessionLocal::com_numQuicksaves( "com_numQuicksaves", "4", CVAR_SYSTEM|CVAR_ARCHIVE|CVAR_INTEGER, "number of quicksaves to keep before overwriting the oldest", 1, 99 ); +idCVar idSessionLocal::com_disableAutoSaves( "com_disableAutoSaves", "0", CVAR_SYSTEM|CVAR_ARCHIVE|CVAR_BOOL, + "Don't create Autosaves when entering a new map" ); idSessionLocal sessLocal; idSession *session = &sessLocal; @@ -1246,8 +1248,8 @@ void idSessionLocal::MoveToNewMap( const char *mapName ) { ExecuteMapChange(); - if ( !mapSpawnData.serverInfo.GetBool("devmap") ) { - // Autosave at the beginning of the level + if ( !com_disableAutoSaves.GetBool() && !mapSpawnData.serverInfo.GetBool("devmap") ) { + // Autosave at the beginning of the level - DG: unless disabled with "com_disableAutoSaves 1" // DG: set an explicit savename to avoid problems with autosave names // (they were translated which caused problems like all alpha labs parts diff --git a/neo/framework/Session_local.h b/neo/framework/Session_local.h index 45acd09e..0317867e 100644 --- a/neo/framework/Session_local.h +++ b/neo/framework/Session_local.h @@ -186,6 +186,7 @@ public: static idCVar com_wipeSeconds; static idCVar com_guid; static idCVar com_numQuicksaves; + static idCVar com_disableAutoSaves; static idCVar gui_configServerRate; diff --git a/neo/framework/Session_menu.cpp b/neo/framework/Session_menu.cpp index e09b14aa..e3c7284b 100644 --- a/neo/framework/Session_menu.cpp +++ b/neo/framework/Session_menu.cpp @@ -482,8 +482,9 @@ void idSessionLocal::HandleRestartMenuCommands( const char *menuCommand ) { } if ( !idStr::Icmp( cmd, "restart" ) ) { - if ( !LoadGame( GetAutoSaveName( mapSpawnData.serverInfo.GetString("si_map") ) ) ) { - // If we can't load the autosave then just restart the map + if ( com_disableAutoSaves.GetBool() // DG: support com_disableAutoSaves + || !LoadGame( GetAutoSaveName( mapSpawnData.serverInfo.GetString("si_map") ) ) ) { + // If we can't load the autosave (or they're disabled) then just restart the map MoveToNewMap( mapSpawnData.serverInfo.GetString("si_map") ); } continue;