From 1a7c63f6bda2a2951c3036a2a40b199d2c73d697 Mon Sep 17 00:00:00 2001 From: sys4-fr Date: Sun, 9 Apr 2017 03:49:24 +0200 Subject: [PATCH] Fix server crash if filter-injector placed on the right of a connected chest is punched --- mods/pipeworks/filter-injector.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mods/pipeworks/filter-injector.lua b/mods/pipeworks/filter-injector.lua index 7fbabc2b..c63b3364 100755 --- a/mods/pipeworks/filter-injector.lua +++ b/mods/pipeworks/filter-injector.lua @@ -144,6 +144,14 @@ local function punch_filter(data, filtpos, filtnode, msg) local dir = minetest.facedir_to_right_dir(filtnode.param2) local frompos = vector.subtract(filtpos, dir) local fromnode = minetest.get_node(frompos) + + -- Fix crash with connected_chests (sys4 fix for MFF) + if fromnode.name == "connected_chests:chest_right" then + local v_mul = vector.multiply(dir, 2) + frompos = vector.subtract(filtpos, v_mul) + fromnode = minetest.get_node(frompos) + end + if not fromnode then return end local fromdef = minetest.registered_nodes[fromnode.name] if not fromdef then return end