From 27481afe060e527f4c67d63cd9cc0f0efb23fa65 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 29 Jun 2017 12:29:59 +0200 Subject: [PATCH] Fix crash if flowing liquid next to unknown node --- mods/CORE/flowlib/init.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mods/CORE/flowlib/init.lua b/mods/CORE/flowlib/init.lua index 96baf99b4..e4e22a20e 100644 --- a/mods/CORE/flowlib/init.lua +++ b/mods/CORE/flowlib/init.lua @@ -64,9 +64,15 @@ flowlib.node_is_liquid = node_is_liquid --This code is more efficient local function quick_flow_logic(node,pos_testing,direction) local name = node.name + if not minetest.registered_nodes[name] then + return 0 + end if minetest.registered_nodes[name].liquidtype == "source" then local node_testing = minetest.get_node(pos_testing) local param2_testing = node_testing.param2 + if not minetest.registered_nodes[node_testing.name] then + return 0 + end if minetest.registered_nodes[node_testing.name].liquidtype ~= "flowing" then return 0 @@ -76,6 +82,9 @@ local function quick_flow_logic(node,pos_testing,direction) elseif minetest.registered_nodes[name].liquidtype == "flowing" then local node_testing = minetest.get_node(pos_testing) local param2_testing = node_testing.param2 + if not minetest.registered_nodes[node_testing.name] then + return 0 + end if minetest.registered_nodes[node_testing.name].liquidtype == "source" then return -direction