diff --git a/src/actor.h b/src/actor.h index 9e96ab2c2..8741a9597 100644 --- a/src/actor.h +++ b/src/actor.h @@ -576,8 +576,7 @@ public: ~AActor (); void Serialize (FArchive &arc); - void PostSerialize(); - + static AActor *StaticSpawn (PClassActor *type, const DVector3 &pos, replace_t allowreplacement, bool SpawningMapThing = false); inline AActor *GetDefault () const diff --git a/src/dthinker.h b/src/dthinker.h index c08ea9d83..10a53309d 100644 --- a/src/dthinker.h +++ b/src/dthinker.h @@ -69,7 +69,6 @@ public: virtual ~DThinker (); virtual void Tick (); virtual void PostBeginPlay (); // Called just before the first tick - virtual void PostSerialize() {} size_t PropagateMark(); void ChangeStatNum (int statnum); diff --git a/src/g_level.cpp b/src/g_level.cpp index 7a8c79d62..141932c22 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -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(§ors[i]); diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index bc4501834..46bc320df 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -397,6 +397,9 @@ void AActor::Serialize(FArchive &arc) if (arc.IsLoading ()) { + touching_sectorlist = NULL; + LinkToWorld(false, Sector); + AddToHash (); SetShade (fillcolor); if (player) @@ -413,17 +416,11 @@ void AActor::Serialize(FArchive &arc) Speed = GetDefault()->Speed; } } + ClearInterpolation(); + UpdateWaterLevel(false); } } -void AActor::PostSerialize() -{ - touching_sectorlist = NULL; - LinkToWorld(false, Sector); - ClearInterpolation(); - UpdateWaterLevel(false); -} - AActor::AActor () throw() { } diff --git a/src/p_saveg.cpp b/src/p_saveg.cpp index 5cec1c815..55320e056 100644 --- a/src/p_saveg.cpp +++ b/src/p_saveg.cpp @@ -363,9 +363,7 @@ void P_SerializeWorld (FArchive &arc) arc << sec->damageamount; arc << sec->damageinterval << sec->leakydamage - << sec->damagetype; - arc << sec->SoundTarget - << sec->SecActTarget + << sec->damagetype << sec->sky << sec->MoreFlags << sec->Flags @@ -453,6 +451,22 @@ void P_SerializeWorld (FArchive &arc) P_CollectLinkedPortals(); } +void P_SerializeWorldActors(FArchive &arc) +{ + int i, j; + sector_t *sec; + + for (i = 0, sec = sectors; i < numsectors; i++, sec++) + { + arc << sec->SoundTarget + << sec->SecActTarget; + } + for (auto &s : sectorPortals) + { + arc << s.mSkybox; + } +} + void extsector_t::Serialize(FArchive &arc) { arc << FakeFloor.Sectors diff --git a/src/p_saveg.h b/src/p_saveg.h index 9ae32cc87..c6c056004 100644 --- a/src/p_saveg.h +++ b/src/p_saveg.h @@ -41,6 +41,7 @@ struct PNGHandle; // These are the load / save game routines. // Also see farchive.(h|cpp) void P_SerializePlayers (FArchive &arc, bool fakeload); +void P_SerializeWorldActors(FArchive &arc); void P_SerializeWorld (FArchive &arc); void P_SerializeThinkers (FArchive &arc, bool); void P_SerializePolyobjs (FArchive &arc); diff --git a/src/portal.cpp b/src/portal.cpp index 7e192d467..3dfd9a050 100644 --- a/src/portal.cpp +++ b/src/portal.cpp @@ -230,8 +230,7 @@ FArchive &operator<< (FArchive &arc, FSectorPortal &port) << port.mOrigin << port.mDestination << port.mDisplacement - << port.mPlaneZ - << port.mSkybox; + << port.mPlaneZ; return arc; } diff --git a/src/version.h b/src/version.h index 2550ce2e2..46c8abf66 100644 --- a/src/version.h +++ b/src/version.h @@ -72,11 +72,11 @@ const char *GetVersionString(); // SAVESIG should match SAVEVER. // MINSAVEVER is the minimum level snapshot version that can be loaded. -#define MINSAVEVER 4539 +#define MINSAVEVER 4540 // Use 4500 as the base git save version, since it's higher than the // SVN revision ever got. -#define SAVEVER 4539 +#define SAVEVER 4540 #define SAVEVERSTRINGIFY2(x) #x #define SAVEVERSTRINGIFY(x) SAVEVERSTRINGIFY2(x)