Skip to content

Commit 33ae484

Browse files
authored
adjreagent now accepts float (space-wizards#38134)
* adjreagent now accepts float * var
1 parent 3871aec commit 33ae484

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

Content.Server/Administration/Toolshed/SolutionCommand.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,21 @@ public IEnumerable<SolutionRef> Get([PipedArgument] IEnumerable<EntityUid> input
3838
public SolutionRef AdjReagent(
3939
[PipedArgument] SolutionRef input,
4040
ProtoId<ReagentPrototype> proto,
41-
FixedPoint2 amount
41+
float amount
4242
)
4343
{
4444
_solutionContainer ??= GetSys<SharedSolutionContainerSystem>();
4545

46-
if (amount > 0)
46+
// Convert float to FixedPoint2
47+
var amountFixed = FixedPoint2.New(amount);
48+
49+
if (amountFixed > 0)
4750
{
48-
_solutionContainer.TryAddReagent(input.Solution, proto, amount, out _);
51+
_solutionContainer.TryAddReagent(input.Solution, proto, amountFixed, out _);
4952
}
50-
else if (amount < 0)
53+
else if (amountFixed < 0)
5154
{
52-
_solutionContainer.RemoveReagent(input.Solution, proto, -amount);
55+
_solutionContainer.RemoveReagent(input.Solution, proto, -amountFixed);
5356
}
5457

5558
return input;
@@ -59,7 +62,7 @@ FixedPoint2 amount
5962
public IEnumerable<SolutionRef> AdjReagent(
6063
[PipedArgument] IEnumerable<SolutionRef> input,
6164
ProtoId<ReagentPrototype> name,
62-
FixedPoint2 amount
65+
float amount
6366
)
6467
=> input.Select(x => AdjReagent(x, name, amount));
6568
}

0 commit comments

Comments
 (0)