Skip to content

Commit

Permalink
- removed bSerialOverride.
Browse files Browse the repository at this point in the history
Now that thinker linking is no longer part of the constructor, this hack is no longer needed.
  • Loading branch information
coelckers committed Jan 13, 2019
1 parent 1a63370 commit acb71de
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 9 deletions.
4 changes: 0 additions & 4 deletions src/dobjtype.cpp
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/dthinker.cpp
Expand Up @@ -56,7 +56,6 @@ DThinker *NextToThink;

FThinkerList DThinker::Thinkers[MAX_STATNUM+2];
FThinkerList DThinker::FreshThinkers[MAX_STATNUM+1];
bool DThinker::bSerialOverride = false;

//==========================================================================
//
Expand Down
1 change: 0 additions & 1 deletion src/dthinker.h
Expand Up @@ -101,7 +101,6 @@ class DThinker : public DObject
static void MarkRoots();

static DThinker *FirstThinker (int statnum);
static bool bSerialOverride;

FLevelLocals *Level;

Expand Down
3 changes: 0 additions & 3 deletions src/serializer.cpp
Expand Up @@ -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)
{
Expand Down Expand Up @@ -1051,7 +1050,6 @@ void FSerializer::ReadObjects(bool hubtravel)
}
EndArray();

DThinker::bSerialOverride = false;
assert(!founderrors);
if (founderrors)
{
Expand All @@ -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;
}
}
Expand Down

0 comments on commit acb71de

Please sign in to comment.