mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-14 00:55:20 +02:00
Refactor CSM restriction code a bit
This also fixes find_node_near restrictions being ineffective.
This commit is contained in:
@@ -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++) {
|
||||
|
Reference in New Issue
Block a user