- fixed: Decals may not be serialized before thinkers.

Since decals may have thinkers attached this will crash when such a savegame gets loaded, because the thinker lists get reset in P_SerializeThinkers, deleting any thinker that already was processed.
I also added an error message that immediately aborts the save process if such an out-of-sequence thinker is attempted to be written out.
This obviously breaks savegame compatibility again...
This commit is contained in:
Christoph Oelckers 2016-04-29 11:44:17 +02:00
commit 4a72c7d2f1
6 changed files with 35 additions and 7 deletions

View file

@ -423,7 +423,6 @@ void P_SerializeWorld (FArchive &arc)
<< si->LeftSide
<< si->RightSide
<< si->Index;
DBaseDecal::SerializeChain (arc, &si->AttachedDecals);
}
}
@ -452,6 +451,7 @@ void P_SerializeWorldActors(FArchive &arc)
{
int i;
sector_t *sec;
line_t *line;
for (i = 0, sec = sectors; i < numsectors; i++, sec++)
{
@ -465,6 +465,16 @@ void P_SerializeWorldActors(FArchive &arc)
{
arc << s.mSkybox;
}
for (i = 0, line = lines; i < numlines; i++, line++)
{
for (int s = 0; s < 2; s++)
{
if (line->sidedef[s] != NULL)
{
DBaseDecal::SerializeChain(arc, &line->sidedef[s]->AttachedDecals);
}
}
}
}
void extsector_t::Serialize(FArchive &arc)
@ -504,6 +514,7 @@ FArchive &operator<< (FArchive &arc, sector_t::splane &p)
void P_SerializeThinkers (FArchive &arc, bool hubLoad)
{
arc.EnableThinkers();
DImpactDecal::SerializeTime (arc);
DThinker::SerializeAll (arc, hubLoad);
}