- fixed: During hub travel, static thinkers may not be deserialized.

Since they are static, the version that got carried over from the last level will still be there and the more current version.
This commit is contained in:
Christoph Oelckers 2017-04-14 22:06:29 +02:00
parent 3d8821ee82
commit c73b71807b
2 changed files with 31 additions and 27 deletions

View file

@ -179,7 +179,10 @@ void DThinker::SerializeThinkers(FSerializer &arc, bool hubLoad)
{
for (i = 0; i <= MAX_STATNUM; i++)
{
if (arc.BeginArray(nullptr))
{
if (!hubLoad || i != STAT_STATIC) // do not load static thinkers in a hub transition because they'd just duplicate the active ones.
{
int size = arc.ArraySize();
for (int j = 0; j < size; j++)
@ -213,6 +216,7 @@ void DThinker::SerializeThinkers(FSerializer &arc, bool hubLoad)
}
}
}
}
arc.EndArray();
}
}

View file

@ -996,7 +996,7 @@ void G_SerializeLevel(FSerializer &arc, bool hubload)
// [ZZ] serialize events
E_SerializeEvents(arc);
DThinker::SerializeThinkers(arc, !hubload);
DThinker::SerializeThinkers(arc, hubload);
arc.Array("polyobjs", polyobjs, po_NumPolyobjs);
SerializeSubsectors(arc, "subsectors");
StatusBar->SerializeMessages(arc);