Added OverlayID() for retrieving psprite layer numbers.

This commit is contained in:
Major Cooke 2016-09-30 15:02:22 -05:00 committed by Christoph Oelckers
parent 671646be26
commit 201ae3c60f
2 changed files with 20 additions and 0 deletions

View file

@ -1049,6 +1049,25 @@ DEFINE_ACTION_FUNCTION(AActor, A_OverlayFlags)
return 0; return 0;
} }
//---------------------------------------------------------------------------
//
// PROC OverlayID
// Because non-action functions cannot acquire the ID of the overlay...
//---------------------------------------------------------------------------
DEFINE_ACTION_FUNCTION(AActor, OverlayID)
{
PARAM_ACTION_PROLOGUE;
if (ACTION_CALL_FROM_PSPRITE())
{
ACTION_RETURN_INT(stateinfo->mPSPIndex);
}
ACTION_RETURN_INT(0);
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //
// PROC A_Lower // PROC A_Lower

View file

@ -57,6 +57,7 @@ ACTOR Actor native //: Thinker
native float GetSpriteAngle(int ptr = AAPTR_DEFAULT); native float GetSpriteAngle(int ptr = AAPTR_DEFAULT);
native float GetSpriteRotation(int ptr = AAPTR_DEFAULT); native float GetSpriteRotation(int ptr = AAPTR_DEFAULT);
native int GetMissileDamage(int mask, int add, int ptr = AAPTR_DEFAULT); native int GetMissileDamage(int mask, int add, int ptr = AAPTR_DEFAULT);
action native int OverlayID();
// Action functions // Action functions
// Meh, MBF redundant functions. Only for DeHackEd support. // Meh, MBF redundant functions. Only for DeHackEd support.