Functions defined in WFL can now access the function table they are defined in as a Lua global variable
This commit is contained in:
parent
141c26d955
commit
cf5e2b1d2c
1 changed files with 3 additions and 0 deletions
|
@ -616,6 +616,9 @@ static int impl_fcntb_set(lua_State* L)
|
|||
lua_setfield(L, -2, w);
|
||||
}
|
||||
lua_setfield(L, -2, "wml");
|
||||
// Also add the function table itself as a global
|
||||
lua_pushvalue(L, 1);
|
||||
lua_setfield(L, -2, "wfl_functions");
|
||||
lua_setupvalue(L, -2, 1);
|
||||
}
|
||||
lua_rawsetp(L, LUA_REGISTRYINDEX, fcn.get());
|
||||
|
|
Loading…
Add table
Reference in a new issue