diff --git a/src/farchive.cpp b/src/farchive.cpp index 477d22718..fc3d75bbb 100644 --- a/src/farchive.cpp +++ b/src/farchive.cpp @@ -1054,6 +1054,12 @@ FArchive &FArchive::SerializePointer (void *ptrbase, BYTE **ptr, DWORD elemSize) FArchive &FArchive::SerializeObject (DObject *&object, PClass *type) { + if (!m_ThinkersAllowed && type->IsDescendantOf(RUNTIME_CLASS(DThinker))) + { + assert(true); + I_Error("Tried to serialize a thinker before P_SerializeThinkers"); + } + if (!type->IsDescendantOf(RUNTIME_CLASS(PClass))) { // a regular object if (IsStoring()) diff --git a/src/farchive.h b/src/farchive.h index b6722986a..44ae8c001 100644 --- a/src/farchive.h +++ b/src/farchive.h @@ -216,6 +216,16 @@ inline FArchive& operator<< (signed char *&str) { return operator<< ((char *&)st inline FArchive& operator<< (bool &b) { return operator<< ((BYTE &)b); } inline FArchive& operator<< (DObject* &object) { return ReadObject (object, RUNTIME_CLASS(DObject)); } + void EnableThinkers() + { + m_ThinkersAllowed = true; + } + + bool ThinkersAllowed() + { + return m_ThinkersAllowed; + } + protected: enum { EObjectHashSize = 137 }; @@ -253,6 +263,7 @@ protected: int *m_SpriteMap; size_t m_NumSprites; + bool m_ThinkersAllowed = false; FArchive (); void AttachToFile (FFile &file); diff --git a/src/g_shared/a_quake.cpp b/src/g_shared/a_quake.cpp index 1d1117125..7908c907c 100644 --- a/src/g_shared/a_quake.cpp +++ b/src/g_shared/a_quake.cpp @@ -72,10 +72,7 @@ void DEarthquake::Serialize (FArchive &arc) << m_QuakeSFX << m_Flags << m_CountdownStart << m_WaveSpeed << m_Falloff << m_Highpoint << m_MiniCount; - if (SaveVersion >= 4544) - { - arc << m_RollIntensity << m_RollWave; - } + << m_RollIntensity << m_RollWave; } //========================================================================== diff --git a/src/p_saveg.cpp b/src/p_saveg.cpp index 9af2cd573..af5992488 100644 --- a/src/p_saveg.cpp +++ b/src/p_saveg.cpp @@ -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); } diff --git a/src/version.h b/src/version.h index 096efa48c..21d05b3ed 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 4543 +#define MINSAVEVER 4545 // Use 4500 as the base git save version, since it's higher than the // SVN revision ever got. -#define SAVEVER 4544 +#define SAVEVER 4545 #define SAVEVERSTRINGIFY2(x) #x #define SAVEVERSTRINGIFY(x) SAVEVERSTRINGIFY2(x) diff --git a/wadsrc/static/xlat/eternity.txt b/wadsrc/static/xlat/eternity.txt index bfdac2cec..bc5159d11 100644 --- a/wadsrc/static/xlat/eternity.txt +++ b/wadsrc/static/xlat/eternity.txt @@ -231,3 +231,6 @@ enum 444 = 0, Teleport(0) 445 = 0, Teleport_NoFog(0) 446 = 0, Teleport_Line(0) +447 = 0, Exit_Normal(0) +448 = 0, Exit_Secret(0) +449 = 0, Teleport_NewMap(0)