Fix two explosion bugs (#10909)

* Fix trigger LINQ error.

* divide by zero
This commit is contained in:
Leon Friedrich
2022-08-29 11:48:49 +12:00
committed by GitHub
parent 0ab4d832f5
commit de7bd0063a
2 changed files with 5 additions and 2 deletions

View File

@@ -158,7 +158,9 @@ public sealed partial class ExplosionSystem : EntitySystem
damagePerIntensity += value * Math.Max(0, ev.DamageCoefficient);
}
explosionTolerance[index] = (float) ((totalDamageTarget - damageable.TotalDamage) / damagePerIntensity);
explosionTolerance[index] = damagePerIntensity > 0
? (float) ((totalDamageTarget - damageable.TotalDamage) / damagePerIntensity)
: float.MaxValue;
}
return explosionTolerance;