1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Refactor CSM restriction code a bit

This also fixes find_node_near restrictions being ineffective.
This commit is contained in:
sfan5 2019-11-08 22:57:03 +01:00
parent 4d668f32a6
commit b0260b5ec8
4 changed files with 27 additions and 32 deletions

View file

@ -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++) {