Filter Explodes->DeathTypes when Threshold is above 0.

This commit is contained in:
Zimmermann Gyula
2018-07-24 19:13:13 +02:00
committed by Paul Chote
parent 6073de52ca
commit e9c3927b0c

View File

@@ -141,6 +141,9 @@ namespace OpenRA.Mods.Common.Traits
if (Info.DamageThreshold == 0)
return;
if (Info.DeathTypes.Count > 0 && !e.Damage.DamageTypes.Overlaps(Info.DeathTypes))
return;
// Cast to long to avoid overflow when multiplying by the health
var source = Info.DamageSource == DamageSource.Self ? self : e.Attacker;
if (health.HP * 100L < Info.DamageThreshold * (long)health.MaxHP)