Custom transfer amount to hydroponic trays (#5833)
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Threading.Tasks;
|
||||
using Content.Server.Atmos;
|
||||
using Content.Server.Atmos.EntitySystems;
|
||||
using Content.Server.Chemistry.EntitySystems;
|
||||
using Content.Server.Chemistry.Components;
|
||||
using Content.Server.Fluids.Components;
|
||||
using Content.Server.Hands.Components;
|
||||
using Content.Server.Plants;
|
||||
@@ -727,23 +728,20 @@ namespace Content.Server.Botany.Components
|
||||
|
||||
var solutionSystem = EntitySystem.Get<SolutionContainerSystem>();
|
||||
if (solutionSystem.TryGetDrainableSolution(usingItem, out var solution)
|
||||
&& solutionSystem.TryGetSolution(Owner, SoilSolutionName, out var targetSolution))
|
||||
&& solutionSystem.TryGetSolution(Owner, SoilSolutionName, out var targetSolution) && _entMan.TryGetComponent(usingItem, out SprayComponent? spray))
|
||||
{
|
||||
var amount = FixedPoint2.New(5);
|
||||
var sprayed = false;
|
||||
var amount = FixedPoint2.New(1);
|
||||
|
||||
var targetEntity = Owner;
|
||||
var solutionEntity = usingItem;
|
||||
|
||||
if (_entMan.TryGetComponent(usingItem, out SprayComponent? spray))
|
||||
{
|
||||
sprayed = true;
|
||||
amount = FixedPoint2.New(1);
|
||||
|
||||
SoundSystem.Play(Filter.Pvs(usingItem), spray.SpraySound.GetSound(), usingItem,
|
||||
AudioHelpers.WithVariation(0.125f));
|
||||
}
|
||||
|
||||
SoundSystem.Play(Filter.Pvs(usingItem), spray.SpraySound.GetSound(), usingItem,
|
||||
AudioHelpers.WithVariation(0.125f));
|
||||
|
||||
|
||||
var split = solutionSystem.Drain(solutionEntity, solution, amount);
|
||||
|
||||
if (split.TotalVolume == 0)
|
||||
{
|
||||
user.PopupMessageCursor(Loc.GetString("plant-holder-component-empty-message",
|
||||
@@ -751,8 +749,7 @@ namespace Content.Server.Botany.Components
|
||||
return true;
|
||||
}
|
||||
|
||||
user.PopupMessageCursor(Loc.GetString(
|
||||
sprayed ? "plant-holder-component-spray-message" : "plant-holder-component-transfer-message",
|
||||
user.PopupMessageCursor(Loc.GetString("plant-holder-component-spray-message",
|
||||
("owner", Owner),
|
||||
("amount", split.TotalVolume)));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user