1
0
mirror of https://github.com/minetest/minetest.git synced 2025-07-06 01:40:21 +02:00

SAPI: Mark all Lua API functions requiring envlock

This commit is contained in:
kwolekr
2015-10-25 00:45:18 -04:00
parent 3936a5e3f7
commit 54f1267c2c
13 changed files with 141 additions and 37 deletions

View File

@ -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)) :