Fix server crash if filter-injector placed on the right of a connected chest is punched

This commit is contained in:
sys4-fr 2017-04-09 03:49:24 +02:00
parent 84e858fccf
commit 1a7c63f6bd
1 changed files with 8 additions and 0 deletions

View File

@ -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