Fixed broken portals after loading saved game

Portals disabled initially and activated by scripting must be fully restored after loading of saved game

https://forum.zdoom.org/viewtopic.php?t=59999
This commit is contained in:
alexey.lysiuk 2018-04-15 10:52:23 +03:00 committed by Christoph Oelckers
parent 35596dbbc4
commit 4ea16acef5
2 changed files with 4 additions and 3 deletions

View file

@ -994,7 +994,7 @@ void G_SerializeLevel(FSerializer &arc, bool hubload)
arc("zones", level.Zones); arc("zones", level.Zones);
arc("lineportals", level.linePortals); arc("lineportals", level.linePortals);
arc("sectorportals", level.sectorPortals); arc("sectorportals", level.sectorPortals);
if (arc.isReading()) P_CollectLinkedPortals(); if (arc.isReading()) P_FinalizePortals();
// [ZZ] serialize events // [ZZ] serialize events
E_SerializeEvents(arc); E_SerializeEvents(arc);

View file

@ -4141,7 +4141,8 @@ void P_SetupLevel (const char *lumpname, int position)
times[16].Clock(); times[16].Clock();
if (reloop) P_LoopSidedefs (false); if (reloop) P_LoopSidedefs (false);
PO_Init (); // Initialize the polyobjs PO_Init (); // Initialize the polyobjs
P_FinalizePortals(); // finalize line portals after polyobjects have been initialized. This info is needed for properly flagging them. if (!savegamerestore)
P_FinalizePortals(); // finalize line portals after polyobjects have been initialized. This info is needed for properly flagging them.
times[16].Unclock(); times[16].Unclock();
assert(sidetemp != NULL); assert(sidetemp != NULL);