Add MAPINFO NoAutoSaveOnEnter - this fully disables autosaves when a map is just entered (ignoring the user's autosave preference).

This commit is contained in:
nashmuhandes 2023-07-15 22:03:58 +08:00 committed by Christoph Oelckers
parent e5a4ed55f3
commit 693ed25414
4 changed files with 9 additions and 0 deletions

View file

@ -1521,6 +1521,12 @@ void FLevelLocals::DoLoadLevel(const FString &nextmapname, int position, bool au
DoDeferedScripts (); // [RH] Do script actions that were triggered on another map.
// [Nash] allow modder control of autosaving
if (flags9 & LEVEL9_NOAUTOSAVEONENTER)
{
autosave = false;
}
// [RH] Always save the game when entering a new
if (autosave && !savegamerestore && disableautosave < 1)
{

View file

@ -1798,6 +1798,7 @@ MapFlagHandlers[] =
{ "forceworldpanning", MITYPE_SETFLAG3, LEVEL3_FORCEWORLDPANNING, 0 },
{ "nousersave", MITYPE_SETFLAG9, LEVEL9_NOUSERSAVE, 0 },
{ "noautomap", MITYPE_SETFLAG9, LEVEL9_NOAUTOMAP, 0 },
{ "noautosaveonenter", MITYPE_SETFLAG9, LEVEL9_NOAUTOSAVEONENTER, 0 },
{ "propermonsterfallingdamage", MITYPE_SETFLAG3, LEVEL3_PROPERMONSTERFALLINGDAMAGE, 0 },
{ "disableshadowmap", MITYPE_SETFLAG3, LEVEL3_NOSHADOWMAP, 0 },
{ "enableshadowmap", MITYPE_CLRFLAG3, LEVEL3_NOSHADOWMAP, 0 },

View file

@ -274,6 +274,7 @@ enum ELevelFlags : unsigned int
// Deliberately skip ahead...
LEVEL9_NOUSERSAVE = 0x00000001,
LEVEL9_NOAUTOMAP = 0x00000002,
LEVEL9_NOAUTOSAVEONENTER = 0x00000004, // don't make an autosave when entering a map
};

View file

@ -1389,6 +1389,7 @@ enum ELevelFlags
LEVEL9_NOUSERSAVE = 0x00000001,
LEVEL9_NOAUTOMAP = 0x00000002,
LEVEL9_NOAUTOSAVEONENTER = 0x00000004, // don't make an autosave when entering a map
};
// [RH] Compatibility flags.