- fixed saving.

This commit is contained in:
Christoph Oelckers 2019-01-09 20:54:36 +01:00
parent 0b2daaf20f
commit 21ac6ab97f
2 changed files with 4 additions and 3 deletions

View file

@ -1675,8 +1675,10 @@ void G_SnapshotLevel ()
if (arc.OpenWriter(save_formatted)) if (arc.OpenWriter(save_formatted))
{ {
SaveVersion = SAVEVER; SaveVersion = SAVEVER;
arc.SetLevel(&level);
G_SerializeLevel(arc, &level, false); G_SerializeLevel(arc, &level, false);
level.info->Snapshot = arc.GetCompressedOutput(); level.info->Snapshot = arc.GetCompressedOutput();
arc.SetLevel(nullptr);
} }
} }
} }
@ -1702,7 +1704,9 @@ void G_UnSnapshotLevel (bool hubLoad)
return; return;
} }
arc.SetLevel(&level);
G_SerializeLevel (arc, &level, hubLoad); G_SerializeLevel (arc, &level, hubLoad);
arc.SetLevel(nullptr);
level.FromSnapshot = true; level.FromSnapshot = true;
TThinkerIterator<AActor> it(NAME_PlayerPawn); TThinkerIterator<AActor> it(NAME_PlayerPawn);

View file

@ -923,8 +923,6 @@ void G_SerializeLevel(FSerializer &arc, FLevelLocals *Level, bool hubload)
{ {
int i = Level->totaltime; int i = Level->totaltime;
arc.SetLevel(&level);
if (arc.isWriting()) if (arc.isWriting())
{ {
arc.Array("checksum", Level->md5, 16); arc.Array("checksum", Level->md5, 16);
@ -1039,6 +1037,5 @@ void G_SerializeLevel(FSerializer &arc, FLevelLocals *Level, bool hubload)
} }
AActor::RecreateAllAttachedLights(); AActor::RecreateAllAttachedLights();
InitPortalGroups(Level); InitPortalGroups(Level);
arc.SetLevel(nullptr);
} }