Added damagetype parameter and XF_NOACTORTYPE to A_Explode.

- By default, A_Explode will refer to the actor's damagetype if using none. The flag forces the function's type if used regardless of type.
This commit is contained in:
Major Cooke 2016-08-12 12:49:55 -05:00 committed by Christoph Oelckers
commit aa2ca77412
3 changed files with 12 additions and 3 deletions

View file

@ -1373,8 +1373,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfArmorType)
enum
{
XF_HURTSOURCE = 1,
XF_NOTMISSILE = 4,
XF_HURTSOURCE = 1,
XF_NOTMISSILE = 4,
XF_NOACTORTYPE = 1 << 3,
};
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Explode)
@ -1388,6 +1389,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Explode)
PARAM_INT_OPT (nails) { nails = 0; }
PARAM_INT_OPT (naildamage) { naildamage = 10; }
PARAM_CLASS_OPT (pufftype, AActor) { pufftype = PClass::FindActor(NAME_BulletPuff); }
PARAM_NAME_OPT (damagetype) { damagetype = NAME_None; }
if (damage < 0) // get parameters from metadata
{
@ -1415,6 +1417,12 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Explode)
}
int count = P_RadiusAttack (self, self->target, damage, distance, self->DamageType, flags, fulldmgdistance);
if (!(flags & XF_NOACTORTYPE) && damagetype == NAME_None)
{
damagetype = self->DamageType;
}
P_RadiusAttack (self, self->target, damage, distance, damagetype, flags, fulldmgdistance);
P_CheckSplash(self, distance);
if (alert && self->target != NULL && self->target->player != NULL)
{