aboutsummaryrefslogtreecommitdiff
path: root/src/script/cpp_api/s_security.cpp
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2020-10-18 14:16:18 +0200
committerElias Fleckenstein <eliasfleckenstein@web.de>2020-10-18 14:16:18 +0200
commit28a560684b9b9048f8436583805f3f733d7ce829 (patch)
tree7615dddb67a38982d10660c751ef4db229a702f8 /src/script/cpp_api/s_security.cpp
parentc1aea404b862256e6bf9316eeb8f32c72b78a4c2 (diff)
downloaddragonfireclient-28a560684b9b9048f8436583805f3f733d7ce829.tar.xz
Added the API additions from waspsaliva
Diffstat (limited to 'src/script/cpp_api/s_security.cpp')
-rw-r--r--src/script/cpp_api/s_security.cpp4
1 files changed, 4 insertions, 0 deletions
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);