From 54f1267c2c87daea769966c694777a2e5977f870 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sun, 25 Oct 2015 00:45:18 -0400 Subject: SAPI: Mark all Lua API functions requiring envlock --- src/script/lua_api/l_env.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/script/lua_api/l_env.cpp') 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(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; } -- cgit v1.2.3