mirror of
https://github.com/PHIDIAS0303/factorio-mod-PHI.git
synced 2025-12-27 11:05:22 +09:00
.
This commit is contained in:
@@ -82,11 +82,10 @@ if settings.startup['PHI-CT'].value then
|
||||
if positions.drop or positions.drop_offset then
|
||||
local pos = math2d.position.ensure_xy(inserter.position)
|
||||
local x_int, x_frac, y_int, y_frac = math.modf(pos.x), math.modf(pos.y)
|
||||
local base_tile = {x = x_frac < 0 and (x_int - 1) or x_int, y = y_frac < 0 and (y_int - 1) or y_int}
|
||||
local pos2 = math2d.position.ensure_xy(inserter.drop_position)
|
||||
local x_int2, x_frac2, y_int2, y_frac2 = math.modf(pos2.x), math.modf(pos2.y)
|
||||
local old_drop_tile, old_drop_offset = {x = x_frac2 < 0 and (x_int2 - 1) or x_int2, y = y_frac2 < 0 and (y_int2 - 1) or y_int2}, {x = x_frac2 < 0 and (x_frac2 + 1) or x_frac2, y = y_frac2 < 0 and (y_frac2 + 1) or y_frac2}
|
||||
inserter.drop_position = math2d.position.add((positions.drop and math2d.position.add(base_tile, positions.drop)) or old_drop_tile, (positions.drop_offset and math2d.position.add(math2d.position.multiply_scalar(positions.drop_offset, 0.2), {0.5, 0.5})) or old_drop_offset)
|
||||
inserter.drop_position = math2d.position.add((positions.drop and math2d.position.add({x = x_frac < 0 and (x_int - 1) or x_int, y = y_frac < 0 and (y_int - 1) or y_int}, positions.drop)) or old_drop_tile, (positions.drop_offset and math2d.position.add(math2d.position.multiply_scalar(positions.drop_offset, 0.2), {0.5, 0.5})) or old_drop_offset)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user