- fixed: AActor::GetModifiedDamage must account for the inventory items to get destroyed in its scripted subfunctions.

This commit is contained in:
Christoph Oelckers 2020-06-12 23:11:45 +02:00 committed by drfrag
parent 19183ba157
commit 7706dd65f9

View file

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