- some reshuffling of save data so that the actors won't get restored before the sectors.

Note that this required splitting P_SerializeWorld, because sector_t and FSectorPortal contain some actor pointers, for which the same rule applies: Portal linking can only be done after all sectors have been read, meaning it cannot be done along with the rest of the data in these structures.

Obviously such a change breaks savegame compatibility so the min. savegame version had to be increased again.
This commit is contained in:
Christoph Oelckers 2016-04-20 19:42:00 +02:00
commit e5dc92f998
8 changed files with 29 additions and 26 deletions

View file

@ -1531,8 +1531,9 @@ void G_SerializeLevel (FArchive &arc, bool hubLoad)
FBehavior::StaticSerializeModuleStates (arc);
if (arc.IsLoading()) interpolator.ClearInterpolations();
P_SerializeWorld(arc);
P_SerializeThinkers (arc, hubLoad);
P_SerializeWorld (arc);
P_SerializeWorldActors(arc); // serializing actor pointers in the world data must be done after SerializeWorld has restored the entire sector state, otherwise LinkToWorld may fail.
P_SerializePolyobjs (arc);
P_SerializeSubsectors(arc);
StatusBar->Serialize (arc);
@ -1579,13 +1580,6 @@ void G_SerializeLevel (FArchive &arc, bool hubLoad)
P_SerializeSounds (arc);
if (arc.IsLoading())
{
FThinkerIterator it(RUNTIME_CLASS(DThinker));
DThinker *th;
while ((th = it.Next()))
{
th->PostSerialize();
}
for (i = 0; i < numsectors; i++)
{
P_Recalculate3DFloors(&sectors[i]);