1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-27 11:10:37 +01:00

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

View File

@ -144,6 +144,17 @@ local function punch_filter(data, filtpos, filtnode, msg)
local dir = minetest.facedir_to_right_dir(filtnode.param2) local dir = minetest.facedir_to_right_dir(filtnode.param2)
local frompos = vector.subtract(filtpos, dir) local frompos = vector.subtract(filtpos, dir)
local fromnode = minetest.get_node(frompos) 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 if not fromnode then return end
local fromdef = minetest.registered_nodes[fromnode.name] local fromdef = minetest.registered_nodes[fromnode.name]
if not fromdef then return end if not fromdef then return end