Fix /sub actually allowing more than two vals now - Fix by subtracting all from the first value - Update the definition too

224249a0d21dd076ebbf73bc990ac8f66e7137f6

Wolfsblvt <wolfsblvt@gmail.com>

1 files changed, +4 -3Ignore whitespace
public/scripts/variables.js+4 -3
@@ -730,7 +730,7 @@ function maxValuesCallback(args, value) {
730730}
731731
732732function subValuesCallback(args, value) {
733733 return performOperation(value, (array) => array[0].reduce((a, b) => a - b, array[1].shift() ?? 0), false, args._scope);
734734}
735735
736736function divValuesCallback(args, value) {
@@ -1716,14 +1716,15 @@ export function registerVariableCommands() {
17161716 returns: 'difference of the provided values',
17171717 unnamedArgumentList: [
17181718 SlashCommandArgument.fromProps({
17191719 description: 'values to findsubtract, starting form the differencefirst provided value',
17201720 typeList: [ARGUMENT_TYPE.NUMBER, ARGUMENT_TYPE.VARIABLE_NAME],
17211721 isRequired: true,
17221722 acceptsMultiple: true,
17231723 enumProvider: commonEnumProviders.variables('all')numbersAndVariables,
17241724 forceEnum: false,
17251725 }),
17261726 ],
1727+ splitUnnamedArgument: true,
17271728 helpString: `
17281729 <div>
17291730 Performs a subtraction of the set of values and passes the result down the pipe.