mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-12-29 04:37:31 +01:00
Fix crash on high levels of frost walker (#4423)
Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4423 Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land> Co-authored-by: WillConker <willconker@noreply.git.minetest.land> Co-committed-by: WillConker <willconker@noreply.git.minetest.land>
This commit is contained in:
parent
1b0deae026
commit
fd4e1484af
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user