diff --git a/changelog.txt b/changelog.txt index 75e1398..391b6f2 100644 --- a/changelog.txt +++ b/changelog.txt @@ -4,6 +4,9 @@ Date: 2024-12-27 Fixes: - Fix size of ore pictures - Ensure recycling changes always happen regardless of mod load order + - Proper workaround for ore generation when added to exsting game: acts as normal generation now + Changes: + - LDS casting now uses titanium plates, with vacuum (thanks SafTheLamb for the recipe idea) --------------------------------------------------------------------------------------------------- Version: 2.0.6 Date: 2024-12-27 diff --git a/control-util.lua b/control-util.lua index 158f049..1b9f33b 100644 --- a/control-util.lua +++ b/control-util.lua @@ -95,6 +95,19 @@ function util.warptorio2_expansion_helper() end end +function util.ore_fix() + for _, resource in pairs(me.resources) do + local map_gen_settings = game.surfaces.nauvis.map_gen_settings + if map_gen_settings.autoplace_controls[resource] == nil then + map_gen_settings.autoplace_controls[resource] = {} + end + if map_gen_settings.autoplace_settings.entity.settings[resource] == nil then + map_gen_settings.autoplace_settings.entity.settings[resource] = {} + end + game.surfaces.nauvis.map_gen_settings = map_gen_settings + end +end + -- A workaround for generating ores until this bug is fixed: -- https://forums.factorio.com/viewtopic.php?f=7&t=124996&p=655013#p655013 diff --git a/control.lua b/control.lua index 7962b95..b5bd7e6 100644 --- a/control.lua +++ b/control.lua @@ -1,5 +1,4 @@ local util = require("control-util") script.on_init(util.check_fluid_mining) - -script.on_event(defines.events.on_chunk_generated, util.ore_workaround) +script.on_configuration_changed(util.ore_fix) diff --git a/me.lua b/me.lua index 1671547..4bd54b0 100644 --- a/me.lua +++ b/me.lua @@ -1,6 +1,7 @@ local me = {} me.name = "bztitanium" +me.resources = {"titanium-ore"} me.fluid_mining = true me.titanium_plate = "" me.titanium_processing = ""