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

@ -7217,15 +7217,15 @@ void AActor::ClearCounters()
}
}
int AActor::GetModifiedDamage(FName damagetype, int damage, bool passive)
int AActor::GetModifiedDamage(FName damagetype, int damage, bool passive, AActor *inflictor, AActor *source, int flags)
{
auto inv = Inventory;
while (inv != nullptr)
{
IFVIRTUALPTRNAME(inv, NAME_Inventory, ModifyDamage)
{
VMValue params[5] = { (DObject*)inv, damage, int(damagetype), &damage, passive };
VMCall(func, params, 5, nullptr, 0);
VMValue params[8] = { (DObject*)inv, damage, int(damagetype), &damage, passive, inflictor, source, flags };
VMCall(func, params, 8, nullptr, 0);
}
inv = inv->Inventory;
}