diff options
author | sfan5 <sfan5@live.de> | 2019-11-08 22:57:03 +0100 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2019-11-11 14:06:48 +0100 |
commit | b0260b5ec8e05e54928f9487bb39b4ff946951f9 (patch) | |
tree | d5e8c2e1c43507549da008dbac2eeba1d6ab059b /src/script/lua_api/l_env.cpp | |
parent | 4d668f32a6d9a0d895a2385dec994d43bd084410 (diff) | |
download | minetest-b0260b5ec8e05e54928f9487bb39b4ff946951f9.tar.gz minetest-b0260b5ec8e05e54928f9487bb39b4ff946951f9.tar.bz2 minetest-b0260b5ec8e05e54928f9487bb39b4ff946951f9.zip |
Refactor CSM restriction code a bit
This also fixes find_node_near restrictions being ineffective.
Diffstat (limited to 'src/script/lua_api/l_env.cpp')
-rw-r--r-- | src/script/lua_api/l_env.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
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<int>(radius, getClient(L)->getCSMNodeRangeLimit()); - } + if (getClient(L)) + radius = getClient(L)->CSMClampRadius(pos, radius); #endif for (int d = start_radius; d <= radius; d++) { |