mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-12 15:33:39 +00:00
move lua Rng wrapper to the lua kernel base
This commit is contained in:
parent
e18cfd7049
commit
e89383d1aa
@ -32,6 +32,7 @@
|
||||
#include "scripting/lua_fileops.hpp"
|
||||
#include "scripting/lua_gui2.hpp"
|
||||
#include "scripting/lua_map_location_ops.hpp"
|
||||
#include "scripting/lua_rng.hpp"
|
||||
#include "scripting/lua_types.hpp"
|
||||
|
||||
#include "version.hpp" // for do_version_check, etc
|
||||
@ -338,6 +339,10 @@ lua_kernel_base::lua_kernel_base(CVideo * video)
|
||||
luaL_setfuncs(L, map_callbacks, 0);
|
||||
lua_setfield(L, -2, "map_location");
|
||||
lua_pop(L,1);
|
||||
|
||||
// Add mersenne twister rng wrapper
|
||||
cmd_log_ << "Adding rng tables...\n";
|
||||
lua_rng::load_tables(L);
|
||||
}
|
||||
|
||||
lua_kernel_base::~lua_kernel_base()
|
||||
|
@ -36,11 +36,6 @@ mapgen_lua_kernel::mapgen_lua_kernel()
|
||||
: lua_kernel_base(NULL)
|
||||
{
|
||||
lua_State *L = mState;
|
||||
|
||||
// Add mersenne twister rng wrapper
|
||||
cmd_log_ << "Adding mt19937 metatable...\n";
|
||||
|
||||
lua_rng::load_tables(L);
|
||||
lua_settop(L, 0);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user