From b0260b5ec8e05e54928f9487bb39b4ff946951f9 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Fri, 8 Nov 2019 22:57:03 +0100 Subject: Refactor CSM restriction code a bit This also fixes find_node_near restrictions being ineffective. --- src/script/lua_api/l_env.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 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 8c2b6ffd8..203ffcfdc 100644 --- a/src/script/lua_api/l_env.cpp +++ b/src/script/lua_api/l_env.cpp @@ -769,11 +769,8 @@ int ModApiEnvMod::l_find_node_near(lua_State *L) #ifndef SERVER // Client API limitations - if (getClient(L) && - getClient(L)->checkCSMRestrictionFlag( - CSMRestrictionFlags::CSM_RF_LOOKUP_NODES)) { - radius = std::max(radius, getClient(L)->getCSMNodeRangeLimit()); - } + if (getClient(L)) + radius = getClient(L)->CSMClampRadius(pos, radius); #endif for (int d = start_radius; d <= radius; d++) { -- cgit v1.2.3