From 4ea16acef57fb0e59b1d044edccf4fa12bad015f Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 15 Apr 2018 10:52:23 +0300 Subject: [PATCH] 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 --- src/p_saveg.cpp | 2 +- src/p_setup.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/p_saveg.cpp b/src/p_saveg.cpp index cf79afc6f..6f38e0ae8 100644 --- a/src/p_saveg.cpp +++ b/src/p_saveg.cpp @@ -994,7 +994,7 @@ void G_SerializeLevel(FSerializer &arc, bool hubload) arc("zones", level.Zones); arc("lineportals", level.linePortals); arc("sectorportals", level.sectorPortals); - if (arc.isReading()) P_CollectLinkedPortals(); + if (arc.isReading()) P_FinalizePortals(); // [ZZ] serialize events E_SerializeEvents(arc); diff --git a/src/p_setup.cpp b/src/p_setup.cpp index d9c5b9200..73fbeb622 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -4141,7 +4141,8 @@ void P_SetupLevel (const char *lumpname, int position) times[16].Clock(); if (reloop) P_LoopSidedefs (false); 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(); assert(sidetemp != NULL); @@ -4377,4 +4378,4 @@ CCMD(dumpgeometry) } } } -} \ No newline at end of file +}