1
0
Fork 0

Don't crash if liquid_range==nil for liquids

objects
Wuzzy 2017-06-08 03:11:59 +02:00
parent 1274df70a7
commit b1b73dd100
1 changed files with 2 additions and 1 deletions

View File

@ -112,9 +112,10 @@ local liquid_flow_action = function(pos, group, action)
* 1: Item must be in liquid group * 1: Item must be in liquid group
* 2a: If target node is below liquid, always succeed * 2a: If target node is below liquid, always succeed
* 2b: If target node is horizontal to liquid: succeed if source, otherwise check param2 for horizontal flow direction ]] * 2b: If target node is horizontal to liquid: succeed if source, otherwise check param2 for horizontal flow direction ]]
local range = d.liquid_range or 8
if (minetest.get_item_group(n.name, group) ~= 0) and if (minetest.get_item_group(n.name, group) ~= 0) and
((yp > 0) or ((yp > 0) or
(yp == 0 and ((d.liquidtype == "source") or (n.param2 > (8-d.liquid_range) and n.param2 < 9)))) then (yp == 0 and ((d.liquidtype == "source") or (n.param2 > (8-range) and n.param2 < 9)))) then
action(pos) action(pos)
end end
end end