Fix renamed argument reference

56ae9d25b0d620892537caa1af4f47c843c0d8a5

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +6 -6Ignore whitespace
public/scripts/variables.js+6 -6
@@ -57,12 +57,12 @@ function setLocalVariable(name, value, args = {}) {
5757 if (localVariable === null) {
5858 localVariable = {};
5959 }
6060 localVariable[args.index] = convertValueType(value, args.typeas);
6161 } else {
6262 if (localVariable === null) {
6363 localVariable = [];
6464 }
6565 localVariable[numIndex] = convertValueType(value, args.typeas);
6666 }
6767 chat_metadata.variables[name] = JSON.stringify(localVariable);
6868 } catch {
@@ -106,12 +106,12 @@ function setGlobalVariable(name, value, args = {}) {
106106 if (globalVariable === null) {
107107 globalVariable = {};
108108 }
109109 globalVariable[args.index] = convertValueType(value, args.typeas);
110110 } else {
111111 if (globalVariable === null) {
112112 globalVariable = [];
113113 }
114114 globalVariable[numIndex] = convertValueType(value, args.typeas);
115115 }
116116 extension_settings.variables.global[name] = JSON.stringify(globalVariable);
117117 } catch {
@@ -841,7 +841,7 @@ function varCallback(args, value) {
841841 if (typeof key != 'string') throw new Error('Key must be a string');
842842 if (args._hasUnnamedArgument) {
843843 const val = typeof value[0] == 'string' ? value.join(' ') : value[0];
844844 args._scope.setVariable(key, val, args.index, args.typeas);
845845 return val;
846846 } else {
847847 return args._scope.getVariable(key, args.index);
@@ -851,7 +851,7 @@ function varCallback(args, value) {
851851 if (typeof key != 'string') throw new Error('Key must be a string');
852852 if (value.length > 0) {
853853 const val = typeof value[0] == 'string' ? value.join(' ') : value[0];
854854 args._scope.setVariable(key, val, args.index, args.typeas);
855855 return val;
856856 } else {
857857 return args._scope.getVariable(key, args.index);