From fd4e1484af3f012485bfd6a8b9a54470eeb35b24 Mon Sep 17 00:00:00 2001 From: WillConker Date: Tue, 11 Jun 2024 19:17:12 +0200 Subject: [PATCH] Fix crash on high levels of frost walker (#4423) Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4423 Reviewed-by: the-real-herowl Co-authored-by: WillConker Co-committed-by: WillConker --- mods/ITEMS/mcl_enchanting/enchantments.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_enchanting/enchantments.lua b/mods/ITEMS/mcl_enchanting/enchantments.lua index 379a18e07..44b3a5bd6 100644 --- a/mods/ITEMS/mcl_enchanting/enchantments.lua +++ b/mods/ITEMS/mcl_enchanting/enchantments.lua @@ -205,7 +205,8 @@ walkover.register_global(function(pos, _, player) if frost_walker <= 0 then return end - local radius = frost_walker + 2 + -- 1011 = sqrt(4096000)/2; 4096000 is the max number of nodes for find_nodes_in_area_under_air + local radius = math.min(frost_walker + 2, 1011) local minp = {x = pos.x - radius, y = pos.y, z = pos.z - radius} local maxp = {x = pos.x + radius, y = pos.y, z = pos.z + radius} local positions = minetest.find_nodes_in_area_under_air(minp, maxp, "mcl_core:water_source")