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_env.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_env.cpp')
-rw-r--r-- | src/script/lua_api/l_env.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/script/lua_api/l_env.cpp b/src/script/lua_api/l_env.cpp index 04b47e6d0..2645c8007 100644 --- a/src/script/lua_api/l_env.cpp +++ b/src/script/lua_api/l_env.cpp @@ -36,10 +36,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "emerge.h" #include "pathfinder.h" -#define GET_ENV_PTR ServerEnvironment* env = \ - dynamic_cast<ServerEnvironment*>(getEnv(L)); \ - if (env == NULL) return 0 - /////////////////////////////////////////////////////////////////////////////// @@ -658,7 +654,7 @@ int ModApiEnvMod::l_find_nodes_in_area_under_air(lua_State *L) // returns world-specific PerlinNoise int ModApiEnvMod::l_get_perlin(lua_State *L) { - GET_ENV_PTR; + GET_ENV_PTR_NO_MAP_LOCK; NoiseParams params; @@ -684,7 +680,7 @@ int ModApiEnvMod::l_get_perlin(lua_State *L) // returns world-specific PerlinNoiseMap int ModApiEnvMod::l_get_perlin_map(lua_State *L) { - GET_ENV_PTR; + GET_ENV_PTR_NO_MAP_LOCK; NoiseParams np; if (!read_noiseparams(L, 1, &np)) @@ -945,6 +941,7 @@ int ModApiEnvMod::l_forceload_free_block(lua_State *L) // get_us_time() int ModApiEnvMod::l_get_us_time(lua_State *L) { + NO_MAP_LOCK_REQUIRED; lua_pushnumber(L, porting::getTimeUs()); return 1; } |