mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-10 23:01:59 +00:00
- fixed: AActor::GetModifiedDamage must account for the inventory items to get destroyed in its scripted subfunctions.
This commit is contained in:
parent
a3c100a2ed
commit
e47f016b23
1 changed files with 3 additions and 2 deletions
|
@ -7359,14 +7359,15 @@ void AActor::ClearCounters()
|
||||||
int AActor::GetModifiedDamage(FName damagetype, int damage, bool passive, AActor *inflictor, AActor *source, int flags)
|
int AActor::GetModifiedDamage(FName damagetype, int damage, bool passive, AActor *inflictor, AActor *source, int flags)
|
||||||
{
|
{
|
||||||
auto inv = Inventory;
|
auto inv = Inventory;
|
||||||
while (inv != nullptr)
|
while (inv != nullptr && !(inv->ObjectFlags & OF_EuthanizeMe))
|
||||||
{
|
{
|
||||||
|
auto nextinv = inv->Inventory;
|
||||||
IFVIRTUALPTRNAME(inv, NAME_Inventory, ModifyDamage)
|
IFVIRTUALPTRNAME(inv, NAME_Inventory, ModifyDamage)
|
||||||
{
|
{
|
||||||
VMValue params[8] = { (DObject*)inv, damage, damagetype.GetIndex(), &damage, passive, inflictor, source, flags };
|
VMValue params[8] = { (DObject*)inv, damage, damagetype.GetIndex(), &damage, passive, inflictor, source, flags };
|
||||||
VMCall(func, params, 8, nullptr, 0);
|
VMCall(func, params, 8, nullptr, 0);
|
||||||
}
|
}
|
||||||
inv = inv->Inventory;
|
inv = nextinv;
|
||||||
}
|
}
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue