aboutsummaryrefslogtreecommitdiff
path: root/src/util/auth.cpp
diff options
context:
space:
mode:
authorNils Dagsson Moskopp <nils@dieweltistgarnichtso.net>2021-12-14 14:06:31 +0100
committerElias Fleckenstein <eliasfleckenstein@web.de>2021-12-14 16:17:49 +0100
commit33087897fdb2ac2bd07700356a8edfa33d5a9ec6 (patch)
tree00cc6a9e845154aeca104abacbecd4cf0a823d93 /src/util/auth.cpp
parent76aa6103e39533d70f3b46e6df902dc6b4dd4104 (diff)
downloadminetest-find_nodes_in_area.tar.xz
Fix minetest.find_nodes_in_area() coord clampingfind_nodes_in_area
Previously, minetest.find_nodes_in_area() was affected by a signed integer overflow, which was fixed by clamping the area in which the function works to MAX_MAP_GENERATION_LIMIT & -MAX_MAP_GENERATION_LIMIT. The problem with that approach is that nodes can exist and even be generated past MAX_MAP_GENERATION_LIMIT in vanilla Minetest – which, despite the name, does not specify exactly where the map generator stops working. Therefore, the bug fix created an unknown amount of other bugs near the map border. At minimum, those bugs affect the outer mapblocks, where nodes past MAX_MAP_GENERATION_LIMIT can be generated. Ironically, the first thing broken by the faulty bug fix was a test case belonging to a workaround that prevents minetest.find_nodes_in_area() being called with coordinates out of s16 bounds in the Mineclonia game, thus avoiding signed integer overflow. Using INT16_MIN+1 & INT16_MAX-1 makes minetest.find_nodes_in_area() work for all coordinates that worked before the faulty fix, avoiding a situation where Minetest can place a node in the map, but then not find it afterwards using minetest_find_nodes_in_area().
Diffstat (limited to 'src/util/auth.cpp')
0 files changed, 0 insertions, 0 deletions