From b31fc70f75eea7d86ece164dc213ab5784aafbd8 Mon Sep 17 00:00:00 2001 From: Brevven Date: Tue, 7 Jan 2025 04:08:50 -0800 Subject: [PATCH] mod compat --- changelog.txt | 5 +++++ data-util.lua | 7 ++++++- info.json | 2 +- lead-recipe-final-stacking.lua | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/changelog.txt b/changelog.txt index 870f3c7..c9eccaf 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,9 @@ --------------------------------------------------------------------------------------------------- +Version: 2.0.13 +Date: 2025-01-07 + Fixes: + - Improve some mod compatibility +--------------------------------------------------------------------------------------------------- Version: 2.0.12 Date: 2025-01-06 Changes: diff --git a/data-util.lua b/data-util.lua index ff639ad..788a86e 100644 --- a/data-util.lua +++ b/data-util.lua @@ -119,7 +119,12 @@ end -- Add the gleba rock. If it exists, still add resource to mine from it function util.add_gleba_rock(resource, amount_min, amount_max) - if not data.raw.planet.gleba then return end + if (not data.raw.planet.gleba or + not data.raw.planet.gleba.map_gen_settings or -- attempted compatibility fixes + not data.raw.planet.gleba.map_gen_settings.autoplace_settings or + not data.raw.planet.gleba.map_gen_settings.autoplace_settings.entity or + not data.raw.planet.gleba.map_gen_settings.autoplace_settings.entity.settings + ) then return end if not data.raw["simple-entity"]["gleba-rock"] then local autoplace_utils = require("autoplace_utils") local hit_effects = require ("__base__.prototypes.entity.hit-effects") diff --git a/info.json b/info.json index f6ec6bb..e770ff2 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "bzlead", - "version": "2.0.12", + "version": "2.0.13", "factorio_version": "2.0", "title": "Lead", "author": "Brevven", diff --git a/lead-recipe-final-stacking.lua b/lead-recipe-final-stacking.lua index 79cce94..8d40e2d 100644 --- a/lead-recipe-final-stacking.lua +++ b/lead-recipe-final-stacking.lua @@ -1,5 +1,5 @@ -- Deadlock stacking recipes -if deadlock then +if deadlock and deadlock["add_stack"] then deadlock.add_stack("lead-ore", "__bzlead__/graphics/icons/stacked/lead-ore-stacked.png", "deadlock-stacking-1", 64) deadlock.add_stack("lead-plate", "__bzlead__/graphics/icons/stacked/lead-plate-stacked.png" , "deadlock-stacking-1", 64) if mods["Krastorio2"] then