From 9cf55fd91b826764dcc852a1d74a66339fc9b3c6 Mon Sep 17 00:00:00 2001 From: Athozus Date: Sat, 13 Apr 2024 10:42:20 +0200 Subject: [PATCH] Add diagonal placement check --- technic/machines/register/cables.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/technic/machines/register/cables.lua b/technic/machines/register/cables.lua index 27fe6a0f..c2057460 100644 --- a/technic/machines/register/cables.lua +++ b/technic/machines/register/cables.lua @@ -96,6 +96,13 @@ function technic.register_cable_plate(nodename, data) def.node_box["connect_"..notconnects[i]] = nil if i == 1 then def.on_place = function(itemstack, placer, pointed_thing) + local count = 0 + for axis in pairs(xyz) do + count = count + (pointed_thing.under[axis] == pointed_thing.above[axis] and 0 or 1) + if count > 1 then + return itemstack + end + end local pointed_thing_diff = vector.direction(pointed_thing.under, pointed_thing.above) local index = pointed_thing_diff.x + (pointed_thing_diff.y*2) + (pointed_thing_diff.z*3) local num = index < 0 and -index + 3 or index