diff options
author | kwolekr <kwolekr@minetest.net> | 2015-10-25 00:45:18 -0400 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2015-10-25 23:06:48 -0400 |
commit | 54f1267c2c87daea769966c694777a2e5977f870 (patch) | |
tree | ae08897774c1b1d1ecae0ad1a31b147c9c98dd02 /src/script/lua_api/l_noise.cpp | |
parent | 3936a5e3f71d46e61f819b8f6c85dd47a440f21e (diff) | |
download | minetest-54f1267c2c87daea769966c694777a2e5977f870.tar.gz minetest-54f1267c2c87daea769966c694777a2e5977f870.tar.bz2 minetest-54f1267c2c87daea769966c694777a2e5977f870.zip |
SAPI: Mark all Lua API functions requiring envlock
Diffstat (limited to 'src/script/lua_api/l_noise.cpp')
-rw-r--r-- | src/script/lua_api/l_noise.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/script/lua_api/l_noise.cpp b/src/script/lua_api/l_noise.cpp index c8dc2d2dc..43dd32023 100644 --- a/src/script/lua_api/l_noise.cpp +++ b/src/script/lua_api/l_noise.cpp @@ -410,6 +410,7 @@ const luaL_reg LuaPerlinNoiseMap::methods[] = { int LuaPseudoRandom::l_next(lua_State *L) { NO_MAP_LOCK_REQUIRED; + LuaPseudoRandom *o = checkobject(L, 1); int min = 0; int max = 32767; @@ -437,6 +438,8 @@ int LuaPseudoRandom::l_next(lua_State *L) int LuaPseudoRandom::create_object(lua_State *L) { + NO_MAP_LOCK_REQUIRED; + int seed = luaL_checknumber(L, 1); LuaPseudoRandom *o = new LuaPseudoRandom(seed); *(void **)(lua_newuserdata(L, sizeof(void *))) = o; @@ -532,6 +535,8 @@ int LuaPcgRandom::l_rand_normal_dist(lua_State *L) int LuaPcgRandom::create_object(lua_State *L) { + NO_MAP_LOCK_REQUIRED; + lua_Integer seed = luaL_checknumber(L, 1); LuaPcgRandom *o = lua_isnumber(L, 2) ? new LuaPcgRandom(seed, lua_tointeger(L, 2)) : |