Merge pull request #532 from sys4-fr/pipeworks_fix_connected_chests

Fix server crash if filter-injector placed on the right of a connected chest is punched
This commit is contained in:
crabman77 2017-04-09 16:07:47 +02:00 committed by GitHub
commit 86f8995530
1 changed files with 11 additions and 0 deletions

View File

@ -144,6 +144,17 @@ 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 and 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)
if fromnode and fromnode.name ~= "connected_chests:chest_left" then
return
end
end
if not fromnode then return end
local fromdef = minetest.registered_nodes[fromnode.name]
if not fromdef then return end