mirror of
https://github.com/Refactorio/RedMew.git
synced 2025-03-03 14:53:01 +02:00
Add an on_init to take redmew_surface and a check for duplicate surfaces
This commit is contained in:
parent
4e8fa9d54a
commit
865b22ed6c
@ -470,7 +470,12 @@ end
|
||||
|
||||
on_surface_created = function (event)
|
||||
local index = event.surface_index
|
||||
stress_map_storage[index] = {}
|
||||
|
||||
if stress_map_storage[index] then
|
||||
table.clear_table(stress_map_storage[index])
|
||||
else
|
||||
stress_map_storage[index] = {}
|
||||
end
|
||||
|
||||
local map = stress_map_storage[index]
|
||||
|
||||
@ -605,4 +610,12 @@ function DiggyCaveCollapse.get_extra_map_info()
|
||||
Place stone walls, stone paths and (refined) concrete to reinforce the mine. If you see cracks appear, run!]]
|
||||
end
|
||||
|
||||
Event.on_init(
|
||||
function()
|
||||
if global.config.redmew_surface.enabled then
|
||||
on_surface_created({surface_index = RS.get_surface().index})
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
return DiggyCaveCollapse
|
||||
|
Loading…
x
Reference in New Issue
Block a user