From d14782fb37fc2283b2043e200a75c234fe298204 Mon Sep 17 00:00:00 2001 From: arookas Date: Wed, 31 Aug 2016 22:04:22 -0400 Subject: [PATCH] Added Thing_Damage3 function It acts as a simple wrapper around P_DamageMobj which can damage a single actor, but can also set the actor inflicting the damage. It returns the amount of damage actually done, or -1 if the damaging was cancelled. --- src/p_acs.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index a2b5275cbe..edabca7847 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -4450,6 +4450,7 @@ enum EACSFunctions */ ACSF_CheckClass = 200, + ACSF_Thing_Damage3, // [arookas] // ZDaemon ACSF_GetTeamScore = 19620, // (int team) @@ -6035,6 +6036,15 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound) const char *clsname = FBehavior::StaticLookupString(args[0]); return !!PClass::FindActor(clsname); } + + case ACSF_Thing_Damage3: // [arookas] wrapper around P_DamageMobj + { + // (target, ptr_select1, inflictor, ptr_select2, amount, damagetype) + AActor* target = COPY_AAPTR(SingleActorFromTID(args[0], activator), args[1]); + AActor* inflictor = COPY_AAPTR(SingleActorFromTID(args[2], activator), args[3]); + FName damagetype(FBehavior::StaticLookupString(args[5])); + return P_DamageMobj(target, inflictor, inflictor, args[4], damagetype); + } default: break;