This commit is contained in:
2025-03-27 00:06:00 +09:00
parent b0b8b88e89
commit fd945b3cb4

View File

@@ -108,9 +108,9 @@ if settings.startup['PHI-CT'].value then
end
function inserter_utils.get_max_range(inserter)
-- local p = (inserter.object_name == 'LuaEntity' and ((inserter.type == 'entity-ghost' and inserter.ghost_prototype) or inserter.prototype)) or ((inserter.object_name == 'LuaEntityPrototype' and inserter) or nil)
local pickup_pos = math2d.position.ensure_xy(math2d.position.add(inserter.inserter_pickup_position, {0.5, 0.5}))
local drop_pos = math2d.position.ensure_xy(math2d.position.add(inserter.inserter_drop_position, {0.5, 0.5}))
local p = inserter.ghost_prototype or inserter.prototype
local pickup_pos = math2d.position.ensure_xy(math2d.position.add(p.inserter_pickup_position, {0.5, 0.5}))
local drop_pos = math2d.position.ensure_xy(math2d.position.add(p.inserter_drop_position, {0.5, 0.5}))
return math.max(math.abs(math.floor(pickup_pos.x)), math.abs(math.floor(pickup_pos.y)), math.abs(math.floor(drop_pos.x)), math.abs(math.floor(drop_pos.y)))
end