1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-02-13 13:49:33 +02:00

prefer positions closer to south

This commit is contained in:
MewMew 2019-11-15 19:00:06 +01:00
parent 42ad8b6557
commit 180b166427

View File

@ -91,7 +91,17 @@ local function set_positions(surface)
if #tile_positions > 1 then table_shuffle_table(tile_positions) end
local tiles = {}
for k, p in pairs(tile_positions) do
tiles[k] = p
if k > 512 then break end
end
if #tiles > 1 then
table.sort(tiles, function (a, b) return a[2] > b[2] end)
end
for k, p in pairs(tiles) do
global.map_collapse.positions[k] = {p[1], p[2]}
if k > 128 then break end
end