Fix being able to set spray amounts in bottles and vapor sprites (#16795)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Content.Server.Fluids.EntitySystems;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
@@ -11,6 +12,9 @@ public sealed class SprayComponent : Component
|
||||
{
|
||||
public const string SolutionName = "spray";
|
||||
|
||||
[DataField("transferAmount")]
|
||||
public FixedPoint2 TransferAmount = 10;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("sprayDistance")]
|
||||
public float SprayDistance = 3.5f;
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ using Content.Server.Cooldown;
|
||||
using Content.Server.Extinguisher;
|
||||
using Content.Server.Fluids.Components;
|
||||
using Content.Server.Popups;
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Cooldown;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Content.Shared.Interaction;
|
||||
@@ -62,9 +61,6 @@ public sealed class SpraySystem : EntitySystem
|
||||
return;
|
||||
}
|
||||
|
||||
if (!TryComp<SolutionTransferComponent>(uid, out var transfer))
|
||||
return;
|
||||
|
||||
var xformQuery = GetEntityQuery<TransformComponent>();
|
||||
var userXform = xformQuery.GetComponent(args.User);
|
||||
|
||||
@@ -89,7 +85,7 @@ public sealed class SpraySystem : EntitySystem
|
||||
var threeQuarters = diffNorm * 0.75f;
|
||||
var quarter = diffNorm * 0.25f;
|
||||
|
||||
var amount = Math.Max(Math.Min((solution.Volume / transfer.TransferAmount).Int(), component.VaporAmount), 1);
|
||||
var amount = Math.Max(Math.Min((solution.Volume / component.TransferAmount).Int(), component.VaporAmount), 1);
|
||||
var spread = component.VaporSpread / amount;
|
||||
// TODO: Just use usedelay homie.
|
||||
var cooldownTime = 0f;
|
||||
@@ -107,7 +103,7 @@ public sealed class SpraySystem : EntitySystem
|
||||
if (distance > component.SprayDistance)
|
||||
target = userMapPos.Offset(diffNorm * component.SprayDistance);
|
||||
|
||||
var newSolution = _solutionContainer.SplitSolution(uid, solution, transfer.TransferAmount);
|
||||
var newSolution = _solutionContainer.SplitSolution(uid, solution, component.TransferAmount);
|
||||
|
||||
if (newSolution.Volume <= FixedPoint2.Zero)
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user