From 06b4421a138d52385ab8cb5d17eabb627a9ed5e5 Mon Sep 17 00:00:00 2001 From: bgkillas Date: Wed, 11 Dec 2024 10:38:10 -0500 Subject: [PATCH] fix logic error maybe --- quant.ew/files/system/item_sync.lua | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/quant.ew/files/system/item_sync.lua b/quant.ew/files/system/item_sync.lua index 25047ab0..10f53c72 100644 --- a/quant.ew/files/system/item_sync.lua +++ b/quant.ew/files/system/item_sync.lua @@ -373,17 +373,23 @@ end local function hole(x, y, item, f) local lx, ly if hole_last[item] ~= nil then - lx, ly = hole_last[item][1] or hole_last[item][3], hole_last[item][2] or hole_last[item][4] - if lx == x and ly == y then - return - end - local inp = math.floor(x).." "..math.floor(lx).." "..math.floor(y).." "..math.floor(ly) - if string.sub(f, -9, -1) == "_giga.xml" then - inp = inp .. " " .. 60 + lx, ly = hole_last[item].last[1], hole_last[item].last[2] + local nx, ny = lx, ly + if hole_last[item].slast ~= nil then + nx, ny = hole_last[item].slast[1], hole_last[item].slast[2] + end + if nx ~= x or ny ~= y then + local inp = math.floor(x).." "..math.floor(nx).." "..math.floor(y).." "..math.floor(ny) + if string.sub(f, -9, -1) == "_giga.xml" then + inp = inp .. " " .. 60 + end + net.proxy_send("cut_through_world_line", inp) end - net.proxy_send("cut_through_world_line", inp) end - hole_last[item] = {lx, ly, x, y} + hole_last[item] = {last = {x, y}} + if lx ~= nil then + hole_last[item].slast = {lx, ly} + end end local DISTANCE_LIMIT = 128 * 4