diff --git a/PHI-CL/control.lua b/PHI-CL/control.lua index b51a2fe..9475c7a 100644 --- a/PHI-CL/control.lua +++ b/PHI-CL/control.lua @@ -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