Fix subtraction bug

This commit is contained in:
2026-04-27 11:05:26 +10:00
parent 830963c890
commit 6a7ea3dab9
2 changed files with 8 additions and 2 deletions

View File

@@ -1332,9 +1332,9 @@ GroundValue interpretGroundInstruction(GroundInstruction inst, GroundScope* scop
} }
if (right->type == INT) { if (right->type == INT) {
result += right->data.intVal; result -= right->data.intVal;
} else if (right->type == DOUBLE) { } else if (right->type == DOUBLE) {
result += right->data.doubleVal; result -= right->data.doubleVal;
} }
addVariable(scope->variables, in->args.args[2].value.refName, createDoubleGroundValue(result)); addVariable(scope->variables, in->args.args[2].value.refName, createDoubleGroundValue(result));

6
tests/log.txt Normal file
View File

@@ -0,0 +1,6 @@
Lists are deprecated, please migrate to using the "collections" library soon.
Ground runtime error:
ErrorType: Hello
ErrorContext: [1, 2, 3, Hi!]
ErrorInstruction: error "Hello" [1, 2, 3, Hi!] 1
ErrorLine: 2