mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 04:51:19 +00:00
- delete thinkers before starting to restore the savegame data to avoid interference of the old thinkers' Destroy() method with the newly loaded data.
Note that even with this change it is still not possible to unarchive any thinker pointers before the thinker list has been loaded as it would create broken lists.
This commit is contained in:
parent
978e522fb4
commit
26a15d0ccc
4 changed files with 10 additions and 5 deletions
|
@ -152,11 +152,6 @@ void DThinker::SerializeAll(FArchive &arc, bool hubLoad)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (hubLoad)
|
||||
DestroyMostThinkers();
|
||||
else
|
||||
DestroyAllThinkers();
|
||||
|
||||
// Prevent the constructor from inserting thinkers into a list.
|
||||
bSerialOverride = true;
|
||||
|
||||
|
|
|
@ -1479,6 +1479,7 @@ void G_SerializeLevel (FArchive &arc, bool hubLoad)
|
|||
int i = level.totaltime;
|
||||
|
||||
Renderer->StartSerialize(arc);
|
||||
if (arc.IsLoading()) P_DestroyThinkers(hubLoad);
|
||||
|
||||
arc << level.flags
|
||||
<< level.flags2
|
||||
|
|
|
@ -519,6 +519,14 @@ void P_SerializeThinkers (FArchive &arc, bool hubLoad)
|
|||
DThinker::SerializeAll (arc, hubLoad);
|
||||
}
|
||||
|
||||
void P_DestroyThinkers(bool hubLoad)
|
||||
{
|
||||
if (hubLoad)
|
||||
DThinker::DestroyMostThinkers();
|
||||
else
|
||||
DThinker::DestroyAllThinkers();
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// ArchiveSounds
|
||||
|
|
|
@ -43,6 +43,7 @@ struct PNGHandle;
|
|||
void P_SerializePlayers (FArchive &arc, bool fakeload);
|
||||
void P_SerializeWorldActors(FArchive &arc);
|
||||
void P_SerializeWorld (FArchive &arc);
|
||||
void P_DestroyThinkers(bool hubLoad);
|
||||
void P_SerializeThinkers (FArchive &arc, bool);
|
||||
void P_SerializePolyobjs (FArchive &arc);
|
||||
void P_SerializeSubsectors(FArchive &arc);
|
||||
|
|
Loading…
Reference in a new issue