From acb71de53ce89cd23952c030f49dcb5fe21c6ce5 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 13 Jan 2019 13:43:43 +0100 Subject: [PATCH] - removed bSerialOverride. Now that thinker linking is no longer part of the constructor, this hack is no longer needed. --- src/dobjtype.cpp | 4 ---- src/dthinker.cpp | 1 - src/dthinker.h | 1 - src/serializer.cpp | 3 --- 4 files changed, 9 deletions(-) diff --git a/src/dobjtype.cpp b/src/dobjtype.cpp index 2e7a006b16..6756d16071 100644 --- a/src/dobjtype.cpp +++ b/src/dobjtype.cpp @@ -563,11 +563,7 @@ void PClass::InitializeDefaults() Defaults = (uint8_t *)M_Malloc(Size); // run the constructor on the defaults to set the vtbl pointer which is needed to run class-aware functions on them. - // Temporarily setting bSerialOverride prevents linking into the thinker chains. - auto s = DThinker::bSerialOverride; - DThinker::bSerialOverride = true; ConstructNative(Defaults); - DThinker::bSerialOverride = s; // We must unlink the defaults from the class list because it's just a static block of data to the engine. DObject *optr = (DObject*)Defaults; GC::Root = optr->ObjNext; diff --git a/src/dthinker.cpp b/src/dthinker.cpp index ac53145c77..1744834674 100644 --- a/src/dthinker.cpp +++ b/src/dthinker.cpp @@ -56,7 +56,6 @@ DThinker *NextToThink; FThinkerList DThinker::Thinkers[MAX_STATNUM+2]; FThinkerList DThinker::FreshThinkers[MAX_STATNUM+1]; -bool DThinker::bSerialOverride = false; //========================================================================== // diff --git a/src/dthinker.h b/src/dthinker.h index 437e425457..c6de53e015 100644 --- a/src/dthinker.h +++ b/src/dthinker.h @@ -101,7 +101,6 @@ public: static void MarkRoots(); static DThinker *FirstThinker (int statnum); - static bool bSerialOverride; FLevelLocals *Level; diff --git a/src/serializer.cpp b/src/serializer.cpp index 283f835f95..4238d2f763 100644 --- a/src/serializer.cpp +++ b/src/serializer.cpp @@ -986,7 +986,6 @@ void FSerializer::ReadObjects(bool hubtravel) // Do not link any thinker that's being created here. This will be done by deserializing the thinker list later. try { - DThinker::bSerialOverride = true; r->mDObjects.Resize(ArraySize()); for (auto &p : r->mDObjects) { @@ -1051,7 +1050,6 @@ void FSerializer::ReadObjects(bool hubtravel) } EndArray(); - DThinker::bSerialOverride = false; assert(!founderrors); if (founderrors) { @@ -1069,7 +1067,6 @@ void FSerializer::ReadObjects(bool hubtravel) r->mDObjects.Clear(); // make sure this flag gets unset, even if something in here throws an error. - DThinker::bSerialOverride = false; throw; } }