mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 06:42:12 +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)
|
||||
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue