- clear current levels' snapshots explicitly if saved game loading fails

Levels that are not defined via MAPINFO could keep stalled snapshots data preventing their loading from scratch

https://forum.zdoom.org/viewtopic.php?t=70115
This commit is contained in:
alexey.lysiuk 2020-10-10 13:04:08 +03:00
parent 5ee272a8b9
commit 1959502a0b

View file

@ -198,6 +198,14 @@ void G_ClearSnapshots (void)
{ {
wadlevelinfos[i].Snapshot.Clean(); wadlevelinfos[i].Snapshot.Clean();
} }
// Clear current levels' snapshots just in case they are not defined via MAPINFO,
// so they were not handled by the loop above
if (primaryLevel && primaryLevel->info)
primaryLevel->info->Snapshot.Clean();
if (currentVMLevel && currentVMLevel->info)
currentVMLevel->info->Snapshot.Clean();
// Since strings are only locked when snapshotting a level, unlock them // Since strings are only locked when snapshotting a level, unlock them
// all now, since we got rid of all the snapshots that cared about them. // all now, since we got rid of all the snapshots that cared about them.
GlobalACSStrings.UnlockAll(); GlobalACSStrings.UnlockAll();