diff --git a/Content.Shared/GameObjects/Components/Chemistry/SharedSolutionContainerComponent.cs b/Content.Shared/GameObjects/Components/Chemistry/SharedSolutionContainerComponent.cs index c455b7a053..7b5721bdb9 100644 --- a/Content.Shared/GameObjects/Components/Chemistry/SharedSolutionContainerComponent.cs +++ b/Content.Shared/GameObjects/Components/Chemistry/SharedSolutionContainerComponent.cs @@ -148,7 +148,7 @@ namespace Content.Shared.GameObjects.Components.Chemistry /// If the solution could be added. public bool TryAddSolution(Solution solution) { - if (!CanAddSolution(solution)) + if (!CanAddSolution(solution) || solution.TotalVolume == 0) return false; Solution.AddSolution(solution); diff --git a/Content.Shared/GameObjects/Components/Damage/DamageableComponent.cs b/Content.Shared/GameObjects/Components/Damage/DamageableComponent.cs index c254389f94..ff60e6f26e 100644 --- a/Content.Shared/GameObjects/Components/Damage/DamageableComponent.cs +++ b/Content.Shared/GameObjects/Components/Damage/DamageableComponent.cs @@ -1,4 +1,4 @@ -#nullable enable +#nullable enable using System; using System.Collections.Generic; using System.Linq; @@ -257,18 +257,25 @@ namespace Content.Shared.GameObjects.Components.Damage finalDamage = Resistances.CalculateDamage(type, amount); } + if (finalDamage == 0) + return false; + if (!_damageList.TryGetValue(type, out var current)) { return false; } - _damageList[type] = current + finalDamage; - - if (_damageList[type] < 0) + if (current + finalDamage < 0) { + if (current == 0) + return false; _damageList[type] = 0; finalDamage = -current; } + else + { + _damageList[type] = current + finalDamage; + } current = _damageList[type];