Fix plant holder double solution transfer (#32813)

This commit is contained in:
slarticodefast
2024-10-16 05:57:30 +02:00
committed by GitHub
parent d871313899
commit 87981f3886
2 changed files with 0 additions and 33 deletions

View File

@@ -228,37 +228,6 @@ public sealed class PlantHolderSystem : EntitySystem
return;
}
if (_solutionContainerSystem.TryGetDrainableSolution(args.Used, out var solution, out _)
&& _solutionContainerSystem.ResolveSolution(uid, component.SoilSolutionName, ref component.SoilSolution)
&& TryComp(args.Used, out SprayComponent? spray))
{
var amount = FixedPoint2.New(1);
var targetEntity = uid;
var solutionEntity = args.Used;
_audio.PlayPvs(spray.SpraySound, args.Used, AudioParams.Default.WithVariation(0.125f));
var split = _solutionContainerSystem.Drain(solutionEntity, solution.Value, amount);
if (split.Volume == 0)
{
_popup.PopupCursor(Loc.GetString("plant-holder-component-no-plant-message",
("owner", args.Used)), args.User);
return;
}
_popup.PopupCursor(Loc.GetString("plant-holder-component-spray-message",
("owner", uid),
("amount", split.Volume)), args.User, PopupType.Medium);
_solutionContainerSystem.TryAddSolution(component.SoilSolution.Value, split);
ForceUpdateByExternalCause(uid, component);
return;
}
if (_tagSystem.HasTag(args.Used, "PlantSampleTaker"))
{
if (component.Seed == null)

View File

@@ -8,8 +8,6 @@ plant-holder-component-no-weeds-message = This plot is devoid of weeds! It doesn
plant-holder-component-remove-plant-message = You remove the plant from the {$name}.
plant-holder-component-remove-plant-others-message = {$name} removes the plant.
plant-holder-component-no-plant-message = There is no plant to remove.
plant-holder-component-empty-message = {$owner} is empty!
plant-holder-component-spray-message = You spray {$owner}.
plant-holder-component-transfer-message = You transfer {$amount}u to {$owner}.
plant-holder-component-nothing-to-sample-message = There is nothing to take a sample of!
plant-holder-component-already-sampled-message = This plant has already been sampled.