contain the statnum hack for visual thinkers on the game side.

This got used from precisely one place, which can easily handle it itself.
This commit is contained in:
Christoph Oelckers 2024-11-23 20:09:50 +01:00
parent 2dcd0fcda4
commit ca3b0737ea
3 changed files with 9 additions and 11 deletions

View file

@ -46,8 +46,6 @@
#include "symbols.h"
#include "types.h"
#include "p_visualthinker.h"
// MACROS ------------------------------------------------------------------
// TYPES -------------------------------------------------------------------
@ -423,7 +421,7 @@ PClass *PClass::FindClass (FName zaname)
//
//==========================================================================
DObject *PClass::CreateNew(int *statnum)
DObject *PClass::CreateNew()
{
uint8_t *mem = (uint8_t *)M_Malloc (Size);
assert (mem != nullptr);
@ -446,12 +444,6 @@ DObject *PClass::CreateNew(int *statnum)
((DObject *)mem)->SetClass (const_cast<PClass *>(this));
InitializeSpecials(mem, Defaults, &PClass::SpecialInits);
if(statnum && ((DObject *)mem)->IsKindOf(RUNTIME_CLASS(DVisualThinker)))
{
*statnum = STAT_VISUALTHINKER;
}
return (DObject *)mem;
}

View file

@ -90,7 +90,7 @@ public:
PClass();
~PClass();
void InsertIntoHash(bool native);
DObject *CreateNew(int *statnum = nullptr);
DObject *CreateNew();
PClass *CreateDerivedClass(FName name, unsigned int size, bool *newlycreated = nullptr, int fileno = 0);
void InitializeActorInfo();

View file

@ -56,6 +56,7 @@
#include "r_data/r_interpolate.h"
#include "doom_aabbtree.h"
#include "doom_levelmesh.h"
#include "p_visualthinker.h"
//============================================================================
//
@ -425,7 +426,12 @@ public:
DThinker *CreateThinker(PClass *cls, int statnum = STAT_DEFAULT)
{
DThinker *thinker = static_cast<DThinker*>(cls->CreateNew(&statnum));
DThinker *thinker = static_cast<DThinker*>(cls->CreateNew());
if (statnum && thinker->IsKindOf(RUNTIME_CLASS(DVisualThinker)))
{
statnum = STAT_VISUALTHINKER;
}
assert(thinker->IsKindOf(RUNTIME_CLASS(DThinker)));
thinker->ObjectFlags |= OF_JustSpawned;
Thinkers.Link(thinker, statnum);