From 28a560684b9b9048f8436583805f3f733d7ce829 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Sun, 18 Oct 2020 14:16:18 +0200 Subject: Added the API additions from waspsaliva --- src/script/cpp_api/s_security.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/script/cpp_api/s_security.cpp') diff --git a/src/script/cpp_api/s_security.cpp b/src/script/cpp_api/s_security.cpp index d8ff667eb..9d65819c0 100644 --- a/src/script/cpp_api/s_security.cpp +++ b/src/script/cpp_api/s_security.cpp @@ -287,6 +287,10 @@ void ScriptApiSecurity::initializeSecurityClient() lua_State *L = getStack(); int thread = getThread(L); + // Backup globals to the registry + lua_getglobal(L, "_G"); + lua_rawseti(L, LUA_REGISTRYINDEX, CUSTOM_RIDX_GLOBALS_BACKUP); + // create an empty environment createEmptyEnv(L); -- cgit v1.2.3