mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Store vector metatable in registry
This commit is contained in:
parent
11aab4198b
commit
06d197cdd0
10 changed files with 36 additions and 21 deletions
|
@ -98,6 +98,7 @@ void ScriptApiSecurity::initializeSecurity()
|
|||
"type",
|
||||
"unpack",
|
||||
"_VERSION",
|
||||
"vector",
|
||||
"xpcall",
|
||||
};
|
||||
static const char *whitelist_tables[] = {
|
||||
|
@ -254,6 +255,10 @@ void ScriptApiSecurity::initializeSecurity()
|
|||
lua_pushnil(L);
|
||||
lua_setfield(L, old_globals, "core");
|
||||
|
||||
// 'vector' as well.
|
||||
lua_pushnil(L);
|
||||
lua_setfield(L, old_globals, "vector");
|
||||
|
||||
lua_pop(L, 1); // Pop globals_backup
|
||||
|
||||
|
||||
|
@ -296,6 +301,7 @@ void ScriptApiSecurity::initializeSecurityClient()
|
|||
"type",
|
||||
"unpack",
|
||||
"_VERSION",
|
||||
"vector",
|
||||
"xpcall",
|
||||
// Completely safe libraries
|
||||
"coroutine",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue