From 242f3728197c0bacbadf2675db212cfdc67f1538 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sat, 25 May 2024 19:33:11 +0700 Subject: [PATCH] Don't do anything in invokeGlobal if init has not been called --- src/main/kotlin/ru/dbotthepony/kstarbound/lua/LuaEnvironment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/lua/LuaEnvironment.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/lua/LuaEnvironment.kt index bf1e8f9a..5bbb3617 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/lua/LuaEnvironment.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/lua/LuaEnvironment.kt @@ -284,7 +284,7 @@ class LuaEnvironment : StateContext { } fun invokeGlobal(name: String, vararg arguments: Any?): Array { - if (errorState) + if (errorState || !initCalled) return arrayOf() val load = globals[name]