Added inflictor, source and flag parameters to GetModifiedDamage on actors and ModifyDamage on inventory.

- The flags are used by DamageMobj so modders can determine radius damage, for example, by checking for DMG_EXPLOSION.
This commit is contained in:
Major Cooke 2019-02-06 13:06:28 -06:00 committed by Christoph Oelckers
commit acc510dfb3
7 changed files with 17 additions and 14 deletions

View file

@ -799,9 +799,9 @@ DEFINE_ACTION_FUNCTION_NATIVE(AActor, ClearCounters, ClearCounters)
return 0;
}
static int GetModifiedDamage(AActor *self, int type, int damage, bool passive)
static int GetModifiedDamage(AActor *self, int type, int damage, bool passive, AActor *inflictor, AActor *source, int flags)
{
return self->GetModifiedDamage(ENamedName(type), damage, passive);
return self->GetModifiedDamage(ENamedName(type), damage, passive, inflictor, source, flags);
}
DEFINE_ACTION_FUNCTION_NATIVE(AActor, GetModifiedDamage, GetModifiedDamage)
@ -810,7 +810,10 @@ DEFINE_ACTION_FUNCTION_NATIVE(AActor, GetModifiedDamage, GetModifiedDamage)
PARAM_NAME(type);
PARAM_INT(damage);
PARAM_BOOL(passive);
ACTION_RETURN_INT(self->GetModifiedDamage(type, damage, passive));
PARAM_OBJECT(inflictor, AActor);
PARAM_OBJECT(source, AActor);
PARAM_INT(flags);
ACTION_RETURN_INT(self->GetModifiedDamage(type, damage, passive, inflictor, source, flags));
}
static int ApplyDamageFactor(AActor *self, int type, int damage)