- removed bSerialOverride.

Now that thinker linking is no longer part of the constructor, this hack is no longer needed.
This commit is contained in:
Christoph Oelckers 2019-01-13 13:43:43 +01:00
parent 1a633701b3
commit acb71de53c
4 changed files with 0 additions and 9 deletions

View file

@ -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;

View file

@ -56,7 +56,6 @@ DThinker *NextToThink;
FThinkerList DThinker::Thinkers[MAX_STATNUM+2];
FThinkerList DThinker::FreshThinkers[MAX_STATNUM+1];
bool DThinker::bSerialOverride = false;
//==========================================================================
//

View file

@ -101,7 +101,6 @@ public:
static void MarkRoots();
static DThinker *FirstThinker (int statnum);
static bool bSerialOverride;
FLevelLocals *Level;

View file

@ -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;
}
}