Fix barotrauma damage total failing when damageable doesn't have the value

This commit is contained in:
ShadowCommander
2021-10-23 12:16:08 -07:00
parent de514758ef
commit e7f352d6c2

View File

@@ -74,9 +74,11 @@ namespace Content.Server.Atmos.EntitySystems
var totalDamage = 0;
foreach (var (barotraumaDamageType, _) in barotrauma.Damage.DamageDict)
{
totalDamage += damageable.Damage.DamageDict[barotraumaDamageType];
if (!damageable.Damage.DamageDict.TryGetValue(barotraumaDamageType, out var damage))
continue;
totalDamage += damage;
}
if (totalDamage > barotrauma.MaxDamage)
if (totalDamage >= barotrauma.MaxDamage)
continue;
var uid = barotrauma.Owner.Uid;