mirror of
https://github.com/Refactorio/RedMew.git
synced 2025-02-21 19:20:07 +02:00
Refactor do_landfill_hidden_tile (#1454)
This commit is contained in:
parent
e6fadf750a
commit
f04b99e40d
@ -30,6 +30,15 @@ local function do_tile_inner(tiles, tile, pos)
|
||||
end
|
||||
end
|
||||
|
||||
local function do_landfill_hidden_tile(tiles, tile, pos)
|
||||
local tt = type(tile) == 'table'
|
||||
local tile_name = (tt and tile.tile) or tile
|
||||
local hidden_tile = tt and tile.hidden_tile
|
||||
if tile_name == 'landfill' and not hidden_tile then
|
||||
insert(tiles, {tile = 'water-shallow', position = pos})
|
||||
end
|
||||
end
|
||||
|
||||
local function do_tile(y, x, data, shape)
|
||||
local pos = {x, y}
|
||||
|
||||
@ -63,6 +72,7 @@ local function do_tile(y, x, data, shape)
|
||||
else
|
||||
do_tile_inner(data.tiles, tile, pos)
|
||||
end
|
||||
do_landfill_hidden_tile(data.hidden_tiles, tile, pos)
|
||||
end
|
||||
|
||||
local function do_row(row, data, shape)
|
||||
@ -109,6 +119,7 @@ local function do_row(row, data, shape)
|
||||
else
|
||||
do_tile_inner(tiles, tile, pos)
|
||||
end
|
||||
do_landfill_hidden_tile(data.hidden_tiles, tile, pos)
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user