Fix potential freeze in core.check_for_falling

This commit is contained in:
savilli 2023-08-27 20:12:53 +02:00 committed by GitHub
parent bf9f831cb2
commit 852d6a7976
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -529,16 +529,16 @@ function core.check_single_for_falling(p)
if same and d_bottom.paramtype2 == "leveled" and
core.get_node_level(p_bottom) <
core.get_node_max_level(p_bottom) then
convert_to_falling_node(p, n)
return true
local success, _ = convert_to_falling_node(p, n)
return success
end
-- Otherwise only if the bottom node is considered "fall through"
if not same and
(not d_bottom.walkable or d_bottom.buildable_to) and
(core.get_item_group(n.name, "float") == 0 or
d_bottom.liquidtype == "none") then
convert_to_falling_node(p, n)
return true
local success, _ = convert_to_falling_node(p, n)
return success
end
end
end