From b1b73dd100ac5e57abe739fc68d3035b3c4ee00c Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 8 Jun 2017 03:11:59 +0200 Subject: [PATCH] Don't crash if liquid_range==nil for liquids --- mods/ITEMS/mcl_core/functions.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_core/functions.lua b/mods/ITEMS/mcl_core/functions.lua index 11c606bbc..719939b53 100644 --- a/mods/ITEMS/mcl_core/functions.lua +++ b/mods/ITEMS/mcl_core/functions.lua @@ -112,9 +112,10 @@ local liquid_flow_action = function(pos, group, action) * 1: Item must be in liquid group * 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 ]] + local range = d.liquid_range or 8 if (minetest.get_item_group(n.name, group) ~= 0) and ((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) end end