Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check effect damage is non-zero before applying rupture to the damage preview #1445

Merged
merged 2 commits into from
Jan 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading