diff --git a/src/p_actionfunctions.cpp b/src/p_actionfunctions.cpp index 3c0d35153..8ac2b5665 100644 --- a/src/p_actionfunctions.cpp +++ b/src/p_actionfunctions.cpp @@ -4564,6 +4564,20 @@ DEFINE_ACTION_FUNCTION(AActor, A_RaiseSelf) ACTION_RETURN_BOOL(P_Thing_Raise(self, NULL, (flags & RF_NOCHECKPOSITION))); } +//=========================================================================== +// +// A_RaiseActor +// +// Generalized version that allows passing pointers for ZScript's sake. +//=========================================================================== +DEFINE_ACTION_FUNCTION(AActor, A_RaiseActor) +{ + PARAM_SELF_PROLOGUE(AActor); + PARAM_OBJECT(other, AActor); + PARAM_INT_DEF(flags); + ACTION_RETURN_BOOL(P_Thing_Raise(other, self, (flags & RF_NOCHECKPOSITION))); +} + //=========================================================================== // // CanRaise diff --git a/src/p_things.cpp b/src/p_things.cpp index 44ef08b94..010eb2e9d 100644 --- a/src/p_things.cpp +++ b/src/p_things.cpp @@ -434,6 +434,9 @@ void P_RemoveThing(AActor * actor) bool P_Thing_Raise(AActor *thing, AActor *raiser, int nocheck) { + if (!thing) + return false; + FState * RaiseState = thing->GetRaiseState(); if (RaiseState == NULL) { diff --git a/wadsrc/static/zscript/actor.txt b/wadsrc/static/zscript/actor.txt index 3ce5cf447..34ed24ad1 100644 --- a/wadsrc/static/zscript/actor.txt +++ b/wadsrc/static/zscript/actor.txt @@ -1092,6 +1092,7 @@ class Actor : Thinker native native void A_RaiseChildren(int flags = 0); native void A_RaiseSiblings(int flags = 0); native bool A_RaiseSelf(int flags = 0); + native bool A_RaiseActor(Actor other, int flags = 0); native bool CanRaise(); native void Revive(); action native bool, Actor A_ThrowGrenade(class itemtype, double zheight = 0, double xyvel = 0, double zvel = 0, bool useammo = true);