diff --git a/src/p_pspr.cpp b/src/p_pspr.cpp index 67a447f61..fab7e38d8 100644 --- a/src/p_pspr.cpp +++ b/src/p_pspr.cpp @@ -1049,6 +1049,25 @@ DEFINE_ACTION_FUNCTION(AActor, A_OverlayFlags) 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 diff --git a/wadsrc/static/actors/actor.txt b/wadsrc/static/actors/actor.txt index c82be96cd..44b801f51 100644 --- a/wadsrc/static/actors/actor.txt +++ b/wadsrc/static/actors/actor.txt @@ -57,6 +57,7 @@ ACTOR Actor native //: Thinker native float GetSpriteAngle(int ptr = AAPTR_DEFAULT); native float GetSpriteRotation(int ptr = AAPTR_DEFAULT); native int GetMissileDamage(int mask, int add, int ptr = AAPTR_DEFAULT); + action native int OverlayID(); // Action functions // Meh, MBF redundant functions. Only for DeHackEd support.