Skip to content

Commit

Permalink
Check effect damage is non-zero before applying rupture to the damage…
Browse files Browse the repository at this point in the history
… preview (#1445)
  • Loading branch information
BlackDog86 authored Jan 6, 2025
1 parent 337cc9f commit 7bdf62b
Showing 1 changed file with 22 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1230,15 +1230,32 @@ function NormalDamagePreview(StateObjectReference TargetRef, out WeaponDamageVal
MaxDamagePreview.Shred += MaxDamagePreview.Shred * BurstFire.NumExtraShots;
}
}

// Begin Issue #1394
/// HL-Docs: ref:Bugfixes; issue:1394
/// Abilities which do not specify a custom damage preview function will show rupture damage on the damage
/// preview, even if the ability is not capable of doing any damage (e.g. self target abilities like reload).
/// Checking that the previewed damage is non-zero before adding rupture damage to it mitigates this and improves
/// the display (mainly for modded gameplay, but it also occurs in niche base game circumstances e.g. if a ruptured
/// unit becomes mind controlled).
if (Rupture > 0)
{
MinDamagePreview.Damage += Rupture;
MaxDamagePreview.Damage += Rupture;
DamageModInfo.bIsRupture = true;
DamageModInfo.Value = Rupture;
MinDamagePreview.BonusDamageInfo.AddItem(DamageModInfo);
MaxDamagePreview.BonusDamageInfo.AddItem(DamageModInfo);
}

if (MinDamagePreview.Damage > 0)
{
MinDamagePreview.Damage += Rupture;
MinDamagePreview.BonusDamageInfo.AddItem(DamageModInfo);
}

if (MaxDamagePreview.Damage > 0)
{
MaxDamagePreview.Damage += Rupture;
MaxDamagePreview.BonusDamageInfo.AddItem(DamageModInfo);
}
}
// End Issue #1394

if (DestructibleState != none)
{
Expand Down

0 comments on commit 7bdf62b

Please sign in to comment.