Added OnLoad virtual

Allows for things to be reinitialized where needed for Thinkers. Moved hidden state of items over to OnLoad.
This commit is contained in:
Boondorl 2025-04-01 15:20:00 -04:00 committed by Ricardo Luís Vaz Silva
commit 524cd55813
5 changed files with 24 additions and 3 deletions

View file

@ -415,12 +415,12 @@ void FThinkerCollection::SerializeThinkers(FSerializer &arc, bool hubLoad)
else if (thinker->ObjectFlags & OF_JustSpawned)
{
FreshThinkers[i].AddTail(thinker);
thinker->PostSerialize();
thinker->CallPostSerialize();
}
else
{
Thinkers[i].AddTail(thinker);
thinker->PostSerialize();
thinker->CallPostSerialize();
}
}
}
@ -833,6 +833,16 @@ void DThinker::PostSerialize()
{
}
void DThinker::CallPostSerialize()
{
PostSerialize();
IFOVERRIDENVIRTUALPTRNAME(this, NAME_Thinker, OnLoad)
{
VMValue params[] = { this };
VMCall(func, params, 1, nullptr, 0);
}
}
//==========================================================================
//
//