mirror of
https://github.com/PHIDIAS0303/factorio-mod-PHI.git
synced 2025-12-27 11:05:22 +09:00
.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user