Minor spill refactors (#5569)

This commit is contained in:
Ygg01
2021-12-05 04:18:30 +01:00
committed by GitHub
parent 5d63411113
commit d1ab9592aa
12 changed files with 248 additions and 253 deletions

View File

@@ -88,6 +88,7 @@ namespace Content.Server.Fluids.Components
* will spill some of the mop's solution onto the puddle which will evaporate eventually.
*/
var solutionSystem = EntitySystem.Get<SolutionContainerSystem>();
var spillableSystem = EntitySystem.Get<SpillableSystem>();
if (!solutionSystem.TryGetSolution(Owner.Uid, SolutionName, out var contents ) ||
Mopping ||
@@ -105,8 +106,8 @@ namespace Content.Server.Fluids.Components
if (eventArgs.Target == null)
{
// Drop the liquid on the mop on to the ground
solutionSystem.SplitSolution(Owner.Uid, contents, FixedPoint2.Min(ResidueAmount, CurrentVolume))
.SpillAt(eventArgs.ClickLocation, "PuddleSmear");
var solution = solutionSystem.SplitSolution(Owner.Uid, contents, FixedPoint2.Min(ResidueAmount, CurrentVolume));
spillableSystem.SpillAt(solution, eventArgs.ClickLocation, "PuddleSmear");
return true;
}
@@ -146,9 +147,9 @@ namespace Content.Server.Fluids.Components
// After cleaning the puddle, make a new puddle with solution from the mop as a "wet floor". Then evaporate it slowly.
// we do this WITHOUT adding to the existing puddle. Otherwise we have might have water puddles with the vomit sprite.
solutionSystem.SplitSolution(Owner.Uid, contents, transferAmount)
.SplitSolution(ResidueAmount)
.SpillAt(eventArgs.ClickLocation, "PuddleSmear", combine: false);
var splitSolution = solutionSystem.SplitSolution(Owner.Uid, contents, transferAmount)
.SplitSolution(ResidueAmount);
spillableSystem.SpillAt(splitSolution, eventArgs.ClickLocation, "PuddleSmear", combine: false);
}
else
{