diff --git a/changelog.txt b/changelog.txt index 9971a6e3..7b8b0562 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,9 @@ --------------------------------------------------------------------------------------------------- +Version: 3.0.20 +Date: 2024-11-9 + Changes: + - Hotfix for crashy migration introduced in 3.0.19 +--------------------------------------------------------------------------------------------------- Version: 3.0.19 Date: 2024-11-9 Changes: diff --git a/migrations/biofluid-in-space-age.lua b/migrations/biofluid-in-space-age.lua index 8b6ebaee..f9330515 100644 --- a/migrations/biofluid-in-space-age.lua +++ b/migrations/biofluid-in-space-age.lua @@ -3,9 +3,13 @@ require "scripts.biofluid.biofluid" storage.network_positions = nil storage.biofluid_undergrounds = nil +storage.biofluid_robots = storage.biofluid_robots or {} +storage.biofluid_requesters = storage.biofluid_requesters or {} storage.biofluid_providers = storage.biofluid_providers or {} +storage.biofluid_bioports = storage.biofluid_bioports or {} +storage.biofluid_networks = storage.biofluid_networks or {} -for _, network_data in pairs(storage.biofluid_networks or {}) do +for _, network_data in pairs(storage.biofluid_networks) do local providers = network_data.providers for _, provider in pairs(providers or {}) do if provider.valid then diff --git a/scripts/biofluid/biofluid.lua b/scripts/biofluid/biofluid.lua index 44e78533..8e84babf 100644 --- a/scripts/biofluid/biofluid.lua +++ b/scripts/biofluid/biofluid.lua @@ -92,7 +92,7 @@ function Biofluid.built_pipe() local allocated_fluids_from_providers = {} for _, network in pairs(storage.biofluid_networks) do - for provider_unit_number, amount in pairs(network.allocated_fluids_from_providers) do + for provider_unit_number, amount in pairs(network.allocated_fluids_from_providers or {}) do allocated_fluids_from_providers[provider_unit_number] = amount + (allocated_fluids_from_providers[provider_unit_number] or 0) end end