diff --git a/src/g_level.cpp b/src/g_level.cpp index e909a79298..aee49e878a 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -1675,8 +1675,10 @@ void G_SnapshotLevel () if (arc.OpenWriter(save_formatted)) { SaveVersion = SAVEVER; + arc.SetLevel(&level); G_SerializeLevel(arc, &level, false); level.info->Snapshot = arc.GetCompressedOutput(); + arc.SetLevel(nullptr); } } } @@ -1702,7 +1704,9 @@ void G_UnSnapshotLevel (bool hubLoad) return; } + arc.SetLevel(&level); G_SerializeLevel (arc, &level, hubLoad); + arc.SetLevel(nullptr); level.FromSnapshot = true; TThinkerIterator it(NAME_PlayerPawn); diff --git a/src/p_saveg.cpp b/src/p_saveg.cpp index 3aa58a63b1..95918faa73 100644 --- a/src/p_saveg.cpp +++ b/src/p_saveg.cpp @@ -923,8 +923,6 @@ void G_SerializeLevel(FSerializer &arc, FLevelLocals *Level, bool hubload) { int i = Level->totaltime; - arc.SetLevel(&level); - if (arc.isWriting()) { arc.Array("checksum", Level->md5, 16); @@ -1039,6 +1037,5 @@ void G_SerializeLevel(FSerializer &arc, FLevelLocals *Level, bool hubload) } AActor::RecreateAllAttachedLights(); InitPortalGroups(Level); - arc.SetLevel(nullptr); }