From 2a74aab4d5f4d811c8b363be59bc0f9234c1d681 Mon Sep 17 00:00:00 2001 From: katsaii Date: Sat, 9 Nov 2024 16:40:24 +0000 Subject: [PATCH] array callsite bug --- src-lts/scripts/scr_catspeak_codegen/scr_catspeak_codegen.gml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src-lts/scripts/scr_catspeak_codegen/scr_catspeak_codegen.gml b/src-lts/scripts/scr_catspeak_codegen/scr_catspeak_codegen.gml index 7b0e4e1..c7f2095 100644 --- a/src-lts/scripts/scr_catspeak_codegen/scr_catspeak_codegen.gml +++ b/src-lts/scripts/scr_catspeak_codegen/scr_catspeak_codegen.gml @@ -1441,7 +1441,9 @@ function __catspeak_expr_call_method__() { var callee_; if (is_array(collection_)) { callee_ = collection_[key_]; - collection_ = undefined; + var shared_ = shared; + // since arrays cannot be used in with statements, let's use something else + collection_ = global.__catspeakGmlSelf ?? (shared_.self_ ?? shared_.globals); } else if (__catspeak_is_withable(collection_)) { callee_ = collection_[$ key_]; } else {