mirror of
https://github.com/Refactorio/RedMew.git
synced 2025-03-03 14:53:01 +02:00
added change landfill misc module
This commit is contained in:
parent
f1567097c0
commit
2ca70327d0
26
map_gen/misc/change_landfill_tile.lua
Normal file
26
map_gen/misc/change_landfill_tile.lua
Normal file
@ -0,0 +1,26 @@
|
||||
local Event = require 'utils.event'
|
||||
|
||||
local tile
|
||||
|
||||
Event.add(
|
||||
defines.events.on_player_built_tile,
|
||||
function(event)
|
||||
local item = event.item
|
||||
if not item or not item.valid then
|
||||
return
|
||||
end
|
||||
|
||||
if event.item.name == 'landfill' then
|
||||
local tiles = event.tiles
|
||||
for i = 1, #tiles do
|
||||
tiles[i].name = tile
|
||||
end
|
||||
local surface = game.surfaces[event.surface_index]
|
||||
surface.set_tiles(tiles)
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
return function(tile_name)
|
||||
tile = tile_name or 'sand-1'
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user