diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index fcd09827bc9..871c680c048 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -43,7 +43,7 @@ END TEMPLATE--> ### Bugfixes -*None yet* +* Fixed the "to" and "take" toolshed commands not working as intended. ### Other diff --git a/Resources/Locale/en-US/toolshed-commands.ftl b/Resources/Locale/en-US/toolshed-commands.ftl index 53603d88f70..0ec32fd9b48 100644 --- a/Resources/Locale/en-US/toolshed-commands.ftl +++ b/Resources/Locale/en-US/toolshed-commands.ftl @@ -219,9 +219,9 @@ command-description-MulVecCommand = command-description-DivVecCommand = Divides every element in the input by a scalar (single value). command-description-rng-to = - Returns a number from its input to its argument (i.e. n..m inclusive) + Returns a number between the input (inclusive) and the argument (exclusive). command-description-rng-from = - Returns a number to its input from its argument (i.e. m..n inclusive) + Returns a number between the argument (inclusive) and the input (exclusive)) command-description-rng-prob = Returns a boolean based on the input probability/chance (from 0 to 1) command-description-sum = diff --git a/Robust.Shared/Toolshed/Commands/Generic/ListGeneration/ToCommand.cs b/Robust.Shared/Toolshed/Commands/Generic/ListGeneration/ToCommand.cs index d7e722e5d72..ab03f8ba5e9 100644 --- a/Robust.Shared/Toolshed/Commands/Generic/ListGeneration/ToCommand.cs +++ b/Robust.Shared/Toolshed/Commands/Generic/ListGeneration/ToCommand.cs @@ -15,5 +15,5 @@ public IEnumerable To( [CommandArgument] ValueRef end ) where T : INumber - => Enumerable.Range(int.CreateTruncating(start), int.CreateTruncating(end.Evaluate(ctx)!)).Select(T.CreateTruncating); + => Enumerable.Range(int.CreateTruncating(start), int.CreateTruncating(end.Evaluate(ctx)! - start)).Select(T.CreateTruncating); } diff --git a/Robust.Shared/Toolshed/Commands/Generic/TakeCommand.cs b/Robust.Shared/Toolshed/Commands/Generic/TakeCommand.cs index 72e1d22bba8..f5716b49de9 100644 --- a/Robust.Shared/Toolshed/Commands/Generic/TakeCommand.cs +++ b/Robust.Shared/Toolshed/Commands/Generic/TakeCommand.cs @@ -7,7 +7,7 @@ namespace Robust.Shared.Toolshed.Commands.Generic; [ToolshedCommand] public sealed class TakeCommand : ToolshedCommand { - [CommandImplementation] + [CommandImplementation, TakesPipedTypeAsGeneric] public IEnumerable Take( [CommandInvocationContext] IInvocationContext ctx, [PipedArgument] IEnumerable input,