summaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_noise.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/lua_api/l_noise.cpp')
-rw-r--r--src/script/lua_api/l_noise.cpp5
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)) :