From 192568b686fa67d1d9d7d2388d9cd984a052f770 Mon Sep 17 00:00:00 2001 From: suchmememanyskill Date: Tue, 27 Jul 2021 22:00:18 +0200 Subject: [PATCH] re-implement tsv2 bug --- source/script/genericClass.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/source/script/genericClass.c b/source/script/genericClass.c index 08053c6..2cf0799 100644 --- a/source/script/genericClass.c +++ b/source/script/genericClass.c @@ -112,11 +112,8 @@ Variable_t* genericCall(Variable_t* var, CallArgs_t* ref) { if (var->variableType != FunctionClass){ SCRIPT_FATAL_ERR("Call on non function class"); } - + Function_t* f = ref->extra; if (var->function.builtIn) { - // TODO: implement arg handling - - Function_t* f = ref->extra; if (f->operations.count == 0) { return genericCallDirect(var, NULL, 0); } @@ -184,10 +181,14 @@ Variable_t* genericCall(Variable_t* var, CallArgs_t* ref) { } } else { - Variable_t *ret = eval(var->function.function.operations.data, var->function.function.operations.count, 1); - if (ret == NULL) + if (f->operations.count){ + if (eval(f->operations.data, f->operations.count, 0) == NULL) + return NULL; + } + + if (eval(var->function.function.operations.data, var->function.function.operations.count, 0) == NULL) return NULL; - removePendingReference(ret); + return &emptyClass; } }