From 7bcc3877faae9af7fab3979ae1d1667a98842c65 Mon Sep 17 00:00:00 2001 From: Daniel Meltzer Date: Fri, 12 Jan 2024 21:24:39 -0500 Subject: [PATCH] Fix heavy pumps crashing new seablock maps (#317) * angelsrefining creates a custom resource for heavy water. This code would remove that custom resource on new map gen, causing pumps to crash. * Fix heavy pumps crashing new seablock maps #317 * Updating changelog #317 --------- Co-authored-by: KiwiHawk <59639+KiwiHawk@users.noreply.github.com> --- SeaBlock/changelog.txt | 1 + SeaBlock/data-updates/misc.lua | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/SeaBlock/changelog.txt b/SeaBlock/changelog.txt index 1715d59..52bbd02 100644 --- a/SeaBlock/changelog.txt +++ b/SeaBlock/changelog.txt @@ -4,6 +4,7 @@ Date: ??? Bugfixes: - Fixed Landfill tech being automatically researched #312 - Fixed AAI Loaders compatibility #315 + - Fixed placement of heavy offshore pumps crashing new seablock maps #317 --------------------------------------------------------------------------------------------------- Version: 0.5.14 Date: 22.12.2023 diff --git a/SeaBlock/data-updates/misc.lua b/SeaBlock/data-updates/misc.lua index a089746..bd433a4 100644 --- a/SeaBlock/data-updates/misc.lua +++ b/SeaBlock/data-updates/misc.lua @@ -65,10 +65,10 @@ end -- Remove resources so mining recipes don't show in FNEI -- Have to leave at least one resource or game will not load for k, v in pairs(data.raw["resource"]) do - if k == "coal" then - v.minable.result = nil - v.minable.results = nil - else + -- Sea-pump-resource is a virtual resource. + -- When the offshore pump is placed, it is supposed to be replaced by the resource and a mining-drill. + -- Removing the resource causes placement of heavy pumps to crash new maps. + if k ~= "sea-pump-resource" then data.raw["resource"][k] = nil end end