- Blood: fixed: The player's inventory and some other state were reset for each level, not each new game.

This commit is contained in:
Christoph Oelckers 2020-10-10 20:20:12 +02:00
parent 78d5b2aa95
commit a39cf290e3
2 changed files with 4 additions and 4 deletions

View file

@ -251,7 +251,6 @@ void NewLevel(MapRecord *sng, int skill)
{ {
if (skill != -1) gGameOptions.nDifficulty = skill; if (skill != -1) gGameOptions.nDifficulty = skill;
gSkill = gGameOptions.nDifficulty; gSkill = gGameOptions.nDifficulty;
cheatReset();
StartLevel(sng); StartLevel(sng);
gameaction = ga_level; gameaction = ga_level;
}; };
@ -275,6 +274,7 @@ void NewLevel(MapRecord *sng, int skill)
void GameInterface::NewGame(MapRecord *sng, int skill) void GameInterface::NewGame(MapRecord *sng, int skill)
{ {
gGameOptions.uGameFlags = 0; gGameOptions.uGameFlags = 0;
cheatReset();
NewLevel(sng, skill); NewLevel(sng, skill);
} }

View file

@ -246,14 +246,14 @@ void PClass::StaticShutdown ()
} }
FunctionPtrList.Clear(); FunctionPtrList.Clear();
VMFunction::DeleteAll(); VMFunction::DeleteAll();
// From this point onward no scripts may be called anymore because the data needed by the VM is getting deleted now.
// This flags DObject::Destroy not to call any scripted OnDestroy methods anymore.
bVMOperational = false;
// Make a full garbage collection here so that all destroyed but uncollected higher level objects // Make a full garbage collection here so that all destroyed but uncollected higher level objects
// that still exist are properly taken down before the low level data is deleted. // that still exist are properly taken down before the low level data is deleted.
GC::FullGC(); GC::FullGC();
// From this point onward no scripts may be called anymore because the data needed by the VM is getting deleted now.
// This flags DObject::Destroy not to call any scripted OnDestroy methods anymore.
bVMOperational = false;
Namespaces.ReleaseSymbols(); Namespaces.ReleaseSymbols();