1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2025-01-12 02:28:02 +02:00

island resort: implemented run_chart_update. Ported commit 68397ed7f96

This commit is contained in:
Maik Wild 2017-12-28 18:17:29 +01:00
parent 53765632ea
commit e52341219a

View File

@ -19,8 +19,10 @@ function run_combined_module(event)
-- run_island( {area = event.area, surface = event.surface, x = x})
end
Thread.queue_action("run_island_place_tiles", {surface = event.surface})
Thread.queue_action("run_chart_update", {area = event.area, surface = event.surface}
end
global.island_tiles_hold = {}
global.island_decoratives_hold = {}
@ -37,6 +39,15 @@ function run_island_place_tiles(params)
end
end
function run_chart_update(params)
local x = params.area.left_top.x / 32
local y = params.area.left_top.y / 32
if game.forces.player.is_chunk_charted(params.surface, {x,y} ) then
-- Don't use full area, otherwise adjacent chunks get charted
game.forces.player.chart(params.surface, {{ params.area.left_top.x, params.area.left_top.y}, { params.area.left_top.x+30, params.area.left_top.y+30} } )
end
end
function run_island( params )
local area = params.area
local surface = params.surface