add betterfall fix

This commit is contained in:
Elkien3 2018-10-19 15:03:17 -05:00
parent aeaff08b78
commit 903e805c7a
2 changed files with 5 additions and 3 deletions

View File

@ -61,7 +61,7 @@ minetest.register_globalstep(function(dtime)
if node_entry then
if node_entry.node.name ~= "air" then
result = betterfall.should_node_fall(node_entry.node, node_entry.pos, 1)
result = betterfall.should_node_fall(node_entry.node, node_entry.pos)
node_entry.meta:set_int("falling", 0)

View File

@ -66,12 +66,14 @@ local supporting_neighbours_diagonal = {
{x = -1, y = -1, z = 1}
}
function betterfall.should_node_fall(n, p, range)
function betterfall.should_node_fall(n, p)
if is_node_supporting(p, {x = p.x, y = p.y - 1, z = p.z}) then
return false
end
if range > 1 then
local range = core.get_item_group(n.name, "falling_node") - 1
if range > 0 then
for i, diagneighpos in pairs(supporting_neighbours_diagonal) do
local dp = {
x = p.x + diagneighpos.x,