mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 20:21:26 +00:00
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.
This commit is contained in:
parent
bf5f10a897
commit
d14782fb37
1 changed files with 10 additions and 0 deletions
|
@ -4450,6 +4450,7 @@ enum EACSFunctions
|
|||
*/
|
||||
|
||||
ACSF_CheckClass = 200,
|
||||
ACSF_Thing_Damage3, // [arookas]
|
||||
|
||||
// ZDaemon
|
||||
ACSF_GetTeamScore = 19620, // (int team)
|
||||
|
@ -6036,6 +6037,15 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue