mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-12-26 18:50:38 +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:
commit
86f8995530
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user