From 18df27d8e708117f64f50624c582bf0d6d0f5287 Mon Sep 17 00:00:00 2001 From: beck-thompson <107373427+beck-thompson@users.noreply.github.com> Date: Sat, 6 Jul 2024 20:52:18 -0700 Subject: [PATCH] Spilling reagents on mutliple entities at once fix (#29763) * Fixed! * That could have been bad this is why I'm glad I check the diff xD --- .../Fluids/EntitySystems/PuddleSystem.Spillable.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Content.Server/Fluids/EntitySystems/PuddleSystem.Spillable.cs b/Content.Server/Fluids/EntitySystems/PuddleSystem.Spillable.cs index 8cdae84a9362c7..e722108e147ecd 100644 --- a/Content.Server/Fluids/EntitySystems/PuddleSystem.Spillable.cs +++ b/Content.Server/Fluids/EntitySystems/PuddleSystem.Spillable.cs @@ -70,13 +70,18 @@ private void SplashOnMeleeHit(Entity entity, ref MeleeHitEve return; args.Handled = true; + + // First update the hit count so anything that is not reactive wont count towards the total! + foreach (var hit in args.HitEntities) + { + if (!HasComp(hit)) + hitCount -= 1; + } + foreach (var hit in args.HitEntities) { if (!HasComp(hit)) - { - hitCount -= 1; // so we don't undershoot solution calculation for actual reactive entities continue; - } var splitSolution = _solutionContainerSystem.SplitSolution(soln.Value, totalSplit / hitCount);