Skip to content

Commit

Permalink
Fix potential freeze in core.check_for_falling
Browse files Browse the repository at this point in the history
  • Loading branch information
savilli committed Aug 27, 2023
1 parent bf9f831 commit 852d6a7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions builtin/game/falling.lua
Expand Up @@ -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
Expand Down

0 comments on commit 852d6a7

Please sign in to comment.