From fd915ce6725ce80150d9098d65f2c0909c111770 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Tue, 5 Sep 2023 17:00:04 +1000 Subject: [PATCH] Update StarLua.cpp --- source/core/StarLua.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/core/StarLua.cpp b/source/core/StarLua.cpp index 41355b1..49d54f3 100644 --- a/source/core/StarLua.cpp +++ b/source/core/StarLua.cpp @@ -97,6 +97,9 @@ void LuaContext::setRequireFunction(RequireFunction requireFunction) { void LuaContext::setCallbacks(String const& tableName, LuaCallbacks const& callbacks) const { auto& eng = engine(); + if (LuaContext::contains(tableName)) + return; + auto callbackTable = eng.createTable(); for (auto const& p : callbacks.callbacks()) callbackTable.set(p.first, eng.createWrappedFunction(p.second));