Skip to content

Commit

Permalink
Spilling reagents on mutliple entities at once fix (space-wizards#29763)
Browse files Browse the repository at this point in the history
* Fixed!

* That could have been bad this is why I'm glad I check the diff xD
  • Loading branch information
beck-thompson authored Jul 7, 2024
1 parent 0098d71 commit 18df27d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Content.Server/Fluids/EntitySystems/PuddleSystem.Spillable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,18 @@ private void SplashOnMeleeHit(Entity<SpillableComponent> 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<ReactiveComponent>(hit))
hitCount -= 1;
}

foreach (var hit in args.HitEntities)
{
if (!HasComp<ReactiveComponent>(hit))
{
hitCount -= 1; // so we don't undershoot solution calculation for actual reactive entities
continue;
}

var splitSolution = _solutionContainerSystem.SplitSolution(soln.Value, totalSplit / hitCount);

Expand Down

0 comments on commit 18df27d

Please sign in to comment.