Add CHANGELEVEL_NOAUTOSAVE flag to ChangeLevel to allow scripted level-switching to bypass autosaving

This commit is contained in:
nashmuhandes 2023-07-16 01:15:25 +08:00 committed by Christoph Oelckers
parent 693ed25414
commit f3b4c6047e
3 changed files with 7 additions and 1 deletions

View file

@ -1437,6 +1437,10 @@ void FLevelLocals::DoLoadLevel(const FString &nextmapname, int position, bool au
{
flags2 |= LEVEL2_PRERAISEWEAPON;
}
if (changeflags & CHANGELEVEL_NOAUTOSAVE)
{
flags9 |= LEVEL9_NOAUTOSAVEONENTER;
}
maptime = 0;

View file

@ -27,6 +27,7 @@ enum
CHANGELEVEL_NOINTERMISSION = 16,
CHANGELEVEL_RESETHEALTH = 32,
CHANGELEVEL_PRERAISEWEAPON = 64,
CHANGELEVEL_NOAUTOSAVE = 128,
};
void G_DoLoadLevel (const FString &MapName, int position, bool autosave, bool newGame);

View file

@ -1270,6 +1270,7 @@ enum EChangeLevelFlags
CHANGELEVEL_NOINTERMISSION = 16,
CHANGELEVEL_RESETHEALTH = 32,
CHANGELEVEL_PRERAISEWEAPON = 64,
CHANGELEVEL_NOAUTOSAVE = 128,
};
enum ELevelFlags
@ -1389,7 +1390,7 @@ enum ELevelFlags
LEVEL9_NOUSERSAVE = 0x00000001,
LEVEL9_NOAUTOMAP = 0x00000002,
LEVEL9_NOAUTOSAVEONENTER = 0x00000004, // don't make an autosave when entering a map
LEVEL9_NOAUTOSAVEONENTER = 0x00000004, // don't make an autosave when entering a map
};
// [RH] Compatibility flags.