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
This commit is contained in:
beck-thompson 2024-07-06 20:52:18 -07:00 committed by deltanedas
parent 14f9c515e9
commit 06f67a73e6
1 changed files with 8 additions and 3 deletions

View File

@ -70,13 +70,18 @@ public sealed partial class PuddleSystem
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);