Ensure that mapgen Lua kernel overrides wesnoth.random()
This commit is contained in:
parent
e6122aefca
commit
5253455021
1 changed files with 7 additions and 0 deletions
|
@ -123,6 +123,13 @@ mapgen_lua_kernel::mapgen_lua_kernel()
|
|||
, default_rng_()
|
||||
{
|
||||
lua_State *L = mState;
|
||||
|
||||
// Unset wesnoth.random. This guarantees that the mapgen_lua_kernel version
|
||||
// of wesnoth.random overrides the lua_kernel_base version.
|
||||
lua_getglobal(L, "wesnoth");
|
||||
lua_pushnil(L);
|
||||
lua_setfield(L, -2, "random");
|
||||
|
||||
lua_settop(L, 0);
|
||||
|
||||
static luaL_Reg const callbacks[] = {
|
||||
|
|
Loading…
Add table
Reference in a new issue