mirror of
https://github.com/Refactorio/RedMew.git
synced 2026-06-19 22:16:03 +02:00
Changed implementation to be compatible with multiple miscs
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
wreck_items_module = {}
|
||||
|
||||
-- adds some wrecked items around the map, good for MP, reduces total resources pulled from factory, and adds incentive to push out
|
||||
|
||||
wreck_item_pool = {}
|
||||
@@ -25,7 +27,7 @@ local function place_entities(surface, entity_list)
|
||||
return false
|
||||
end
|
||||
|
||||
function run_misc_module(event)
|
||||
function wreck_items_module.on_chunk_generated(event)
|
||||
local surface = event.surface
|
||||
for x = 0, 31, 1 do
|
||||
for y = 0, 31, 1 do
|
||||
@@ -50,3 +52,6 @@ function run_misc_module(event)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return wreck_items_module
|
||||
|
||||
+3
-3
@@ -46,7 +46,7 @@ in this file and your run_*type*_module(event) function will be called.
|
||||
miscs = {}
|
||||
--miscs[1] = require "locale.gen_misc.rail_grid"
|
||||
--require "locale.gen_misc.rusky_pvp"
|
||||
--require "locale.gen_misc.wreck_items"
|
||||
--miscs[1] = require "locale.gen_misc.wreck_items"
|
||||
|
||||
local on_chunk_generated = function(event)
|
||||
if run_combined_module == nil then
|
||||
@@ -65,8 +65,8 @@ local on_chunk_generated = function(event)
|
||||
run_ores_module(event)
|
||||
end
|
||||
end
|
||||
if run_misc_module ~= nil then
|
||||
run_misc_module(event)
|
||||
for _,v in pairs(miscs) do
|
||||
v.on_chunk_generated(event)
|
||||
end
|
||||
else
|
||||
run_combined_module(event)
|
||||
|
||||
Reference in New Issue
Block a user