Fixed target container overflow (Infinite beaker fill from mop) (#16804)
This commit is contained in:
@@ -25,6 +25,7 @@ public sealed class AbsorbentSystem : SharedAbsorbentSystem
|
|||||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||||
[Dependency] private readonly SolutionContainerSystem _solutionSystem = default!;
|
[Dependency] private readonly SolutionContainerSystem _solutionSystem = default!;
|
||||||
[Dependency] private readonly UseDelaySystem _useDelay = default!;
|
[Dependency] private readonly UseDelaySystem _useDelay = default!;
|
||||||
|
[Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
@@ -158,11 +159,18 @@ public sealed class AbsorbentSystem : SharedAbsorbentSystem
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
absorberSoln.AddReagent(PuddleSystem.EvaporationReagent, water);
|
|
||||||
refillableSolution.AddSolution(nonWater, _prototype);
|
|
||||||
|
|
||||||
_solutionSystem.UpdateChemicals(used, absorberSoln);
|
if (water > 0 && !_solutionContainerSystem.TryAddReagent(used, absorberSoln, PuddleSystem.EvaporationReagent, water,
|
||||||
_solutionSystem.UpdateChemicals(target, refillableSolution);
|
out _))
|
||||||
|
{
|
||||||
|
_popups.PopupEntity(Loc.GetString("mopping-system-full", ("used", used)), used, user);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nonWater.Volume > 0 && !_solutionContainerSystem.TryAddSolution(target, refillableSolution, nonWater))
|
||||||
|
{
|
||||||
|
absorberSoln.AddSolution(nonWater, _prototype);
|
||||||
|
_popups.PopupEntity(Loc.GetString("mopping-system-full", ("used", target)), user, user);
|
||||||
|
}
|
||||||
_audio.PlayPvs(component.TransferSound, target);
|
_audio.PlayPvs(component.TransferSound, target);
|
||||||
_useDelay.BeginDelay(used);
|
_useDelay.BeginDelay(used);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user