- moved the global spot state into FLevelLocals.

This way it doesn't even have to be a thinker.
This commit is contained in:
Christoph Oelckers 2019-01-05 10:04:27 +01:00
commit dab68184f5
14 changed files with 39 additions and 44 deletions

View file

@ -42,7 +42,6 @@
static FRandom pr_spot ("SpecialSpot");
IMPLEMENT_CLASS(DSpotState, false, false)
TObjPtr<DSpotState*> DSpotState::SpotState;
//----------------------------------------------------------------------------
//
@ -198,16 +197,7 @@ FSerializer &Serialize(FSerializer &arc, const char *key, FSpotList &list, FSpot
//----------------------------------------------------------------------------
DSpotState::DSpotState ()
: DThinker (STAT_INFO)
{
if (SpotState)
{
I_Error ("Only one SpotState is allowed to exist at a time.\nCheck your code.");
}
else
{
SpotState = this;
}
}
//----------------------------------------------------------------------------
@ -219,8 +209,6 @@ DSpotState::DSpotState ()
void DSpotState::OnDestroy ()
{
SpotLists.Reset();
SpotState = NULL;
Super::OnDestroy();
}
@ -240,18 +228,6 @@ void DSpotState::Tick ()
//
//----------------------------------------------------------------------------
DSpotState *DSpotState::GetSpotState(bool create)
{
if (SpotState == NULL && create) SpotState = Create<DSpotState>();
return SpotState;
}
//----------------------------------------------------------------------------
//
//
//
//----------------------------------------------------------------------------
FSpotList *DSpotState::FindSpotList(PClassActor *type)
{
if (type == nullptr) return nullptr;