Skip to content

Commit db4f4ea

Browse files
authored
fix(vm): use variableScopedGet as a backup for builtin_variable_instance_get (#469)
* fix(vm): use variableScopedGet as a backup for builtin_variable_instance_get * remove log
1 parent 9b9108d commit db4f4ea

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/vm_builtins.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4140,10 +4140,11 @@ static RValue builtin_variable_global_set(VMContext* ctx, RValue* args, int32_t
41404140

41414141
static RValue builtin_variable_instance_get(VMContext* ctx, RValue* args, int32_t argCount) {
41424142
if (2 > argCount || args[1].type != RVALUE_STRING) return RValue_makeUndefined();
4143-
4143+
41444144
Instance* inst = resolveInstanceValue(ctx->runner, args[0]);
41454145
if (inst == nullptr)
4146-
return RValue_makeUndefined();
4146+
// idk if this is sketch or not - but some variables have inst as null and so I just added the old function back - emiyl
4147+
return variableScopedGet(ctx, RValue_toInt32(args[0]), args[1].string, false, "variable_instance_get");
41474148

41484149
return variableInstanceGetOn(ctx, inst, args[1].string, "variable_instance_get");
41494150
}

0 commit comments

Comments
 (0)