From 822258eee0c8c794bb1f4e2fd086a1ff72e6183b Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Wed, 12 Feb 2025 20:39:07 +0900 Subject: [PATCH] . --- exp_legacy/module/modules/addons/miner.lua | 29 +++++----------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/exp_legacy/module/modules/addons/miner.lua b/exp_legacy/module/modules/addons/miner.lua index fd192704..2d6ca6f6 100644 --- a/exp_legacy/module/modules/addons/miner.lua +++ b/exp_legacy/module/modules/addons/miner.lua @@ -110,30 +110,13 @@ local function miner_check(entity) if config.fluid and entity.fluidbox and #entity.fluidbox > 0 then table.insert(pipe_build, { x = 0, y = 0 }) - local rh = math.ceil(er / 2) - local r = er + 1 - local entities = es.find_entities_filtered{ area = { { ep.x - r, ep.y - r }, { ep.x + r, ep.y + r } }, type = { "mining-drill", "pipe", "pipe-to-ground" } } - local entities_t = es.find_entities_filtered{ area = { { ep.x - r, ep.y - r }, { ep.x + r, ep.y + r } }, ghost_type = { "mining-drill", "pipe", "pipe-to-ground" } } - - table.insert_array(entities, entities_t) - - for _, e in pairs(entities) do - if (e.position.x > ep.x) and (e.position.y == ep.y) then - for h = 1, rh do - table.insert(pipe_build, { x = h, y = 0 }) - end - elseif (e.position.x < ep.x) and (e.position.y == ep.y) then - for h = 1, rh do - table.insert(pipe_build, { x = -h, y = 0 }) - end - elseif (e.position.x == ep.x) and (e.position.y > ep.y) then - for h = 1, rh do - table.insert(pipe_build, { x = 0, y = h }) - end - elseif (e.position.x == ep.x) and (e.position.y < ep.y) then - for h = 1, rh do - table.insert(pipe_build, { x = 0, y = -h }) + for i = 1, #entity.fluidbox do + for _, p in pairs(entity.fluidbox[i].get_pipe_connections(i)) do + for x = 1, p.position.x do + for y = 1, p.position.y do + table.insert(pipe_build, { x = x, y = y }) + end end end end