diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index e03d674c78..957f3e361f 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -323,6 +323,40 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, GetDistance) return 0; } +//========================================================================== +// +// GetSpawnHealth +// +//========================================================================== +DEFINE_ACTION_FUNCTION_PARAMS(AActor, GetSpawnHealth) +{ + if (numret > 0) + { + PARAM_PROLOGUE; + PARAM_OBJECT(self, AActor); + ret->SetInt(self->SpawnHealth()); + return 1; + } + return 0; +} + +//========================================================================== +// +// GetGibHealth +// +//========================================================================== +DEFINE_ACTION_FUNCTION_PARAMS(AActor, GetGibHealth) +{ + if (numret > 0) + { + PARAM_PROLOGUE; + PARAM_OBJECT(self, AActor); + ret->SetInt(self->GetGibHealth()); + return 1; + } + return 0; +} + //=========================================================================== // // __decorate_internal_state__ diff --git a/wadsrc/static/actors/actor.txt b/wadsrc/static/actors/actor.txt index 642269f283..34fbd5cef7 100644 --- a/wadsrc/static/actors/actor.txt +++ b/wadsrc/static/actors/actor.txt @@ -42,6 +42,8 @@ ACTOR Actor native //: Thinker native bool IsPointerEqual(int ptr_select1, int ptr_select2); native int CountInv(class itemtype, int ptr_select = AAPTR_DEFAULT); native float GetDistance(bool checkz, int ptr = AAPTR_DEFAULT); + native int GetSpawnHealth(); + native int GetGibHealth(); // Action functions // Meh, MBF redundant functions. Only for DeHackEd support.