Changed implementation to be compatible with multiple miscs

This commit is contained in:
TWLTriston
2017-09-28 11:41:55 -04:00
parent 3dcc0c36b8
commit 638eadc890
2 changed files with 9 additions and 4 deletions
+6 -1
View File
@@ -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
View File
@@ -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)