mirror of
https://github.com/PHIDIAS0303/factorio-mod-PHI.git
synced 2025-12-31 04:11:39 +09:00
.
This commit is contained in:
@@ -108,9 +108,9 @@ if settings.startup['PHI-CT'].value then
|
|||||||
end
|
end
|
||||||
|
|
||||||
function inserter_utils.get_max_range(inserter)
|
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 p = inserter.ghost_prototype or inserter.prototype
|
||||||
local pickup_pos = math2d.position.ensure_xy(math2d.position.add(inserter.inserter_pickup_position, {0.5, 0.5}))
|
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(inserter.inserter_drop_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)))
|
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
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user