Skip to content

Commit

Permalink
Fix "to" and "take" toolshed commands (#5438)
Browse files Browse the repository at this point in the history
  • Loading branch information
ElectroJr authored Sep 13, 2024
1 parent 0f60ad9 commit 4949b34
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ END TEMPLATE-->

### Bugfixes

*None yet*
* Fixed the "to" and "take" toolshed commands not working as intended.

### Other

Expand Down
4 changes: 2 additions & 2 deletions Resources/Locale/en-US/toolshed-commands.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ public IEnumerable<T> To<T>(
[CommandArgument] ValueRef<T> end
)
where T : INumber<T>
=> 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);
}
2 changes: 1 addition & 1 deletion Robust.Shared/Toolshed/Commands/Generic/TakeCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Robust.Shared.Toolshed.Commands.Generic;
[ToolshedCommand]
public sealed class TakeCommand : ToolshedCommand
{
[CommandImplementation]
[CommandImplementation, TakesPipedTypeAsGeneric]
public IEnumerable<T> Take<T>(
[CommandInvocationContext] IInvocationContext ctx,
[PipedArgument] IEnumerable<T> input,
Expand Down

0 comments on commit 4949b34

Please sign in to comment.