Added GetDecalName()

This commit is contained in:
Boondorl 2024-08-17 11:29:23 -04:00 committed by Rachael Alexanderson
parent 3524d06813
commit 8c10ac6f38
4 changed files with 24 additions and 0 deletions

View file

@ -205,6 +205,11 @@ const FDecalTemplate *FDecalBase::GetDecal () const
return NULL;
}
FName FDecalBase::GetDecalName() const
{
return Name;
}
void FDecalTemplate::ReplaceDecalRef(FDecalBase *from, FDecalBase *to)
{
if (LowerDecal == from)

View file

@ -53,6 +53,7 @@ class FDecalBase
public:
virtual const FDecalTemplate *GetDecal () const;
virtual void ReplaceDecalRef (FDecalBase *from, FDecalBase *to) = 0;
FName GetDecalName() const;
protected:
FDecalBase ();

View file

@ -934,3 +934,20 @@ DEFINE_ACTION_FUNCTION_NATIVE(ADecal, SpawnDecal, SpawnDecal)
SpawnDecal(self);
return 0;
}
//----------------------------------------------------------------------------
//
//
//
//----------------------------------------------------------------------------
static int GetDecalName(AActor* self)
{
return self->DecalGenerator != nullptr ? self->DecalGenerator->GetDecalName().GetIndex() : NAME_None;
}
DEFINE_ACTION_FUNCTION_NATIVE(AActor, GetDecalName, GetDecalName)
{
PARAM_SELF_PROLOGUE(AActor);
ACTION_RETURN_INT(GetDecalName(self));
}

View file

@ -715,6 +715,7 @@ class Actor : Thinker native
native void ClearFOVInterpolation();
native clearscope Vector3 PosRelative(sector sec) const;
native void RailAttack(FRailParams p);
native clearscope Name GetDecalName() const;
native void HandleSpawnFlags();
native void ExplodeMissile(line lin = null, Actor target = null, bool onsky = false);