Skip to content

Commit

Permalink
Fix site properties for really old sites
Browse files Browse the repository at this point in the history
Closes #196
  • Loading branch information
narc0tiq committed Dec 30, 2024
1 parent 66a3d8c commit dea812d
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion resmon/migrations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ local migrations = {
function migrations_module.default_versions()
---@type {[string]: number}
local default_versions = {
force_data = 3,
force_data = 4,
ore_tracker = 2,
player_data = 1,
versions = 1,
Expand Down Expand Up @@ -135,4 +135,21 @@ function migrations.force_data.v2()
return 3
end

---2024-12-30, YARM v1.0.4:<br>
--- - Create site.scanned_ore_per_minute if missing
function migrations.force_data.v3()
for _, force in pairs(game.forces) do
local force_data = storage.force_data[force.name]
if force_data and force_data.ore_sites then
for _, site in pairs(force_data.ore_sites) do
if not site.scanned_ore_per_minute then
site.scanned_ore_per_minute = site.ore_per_minute
end
end
end
end
return 4
end


return migrations_module

0 comments on commit dea812d

Please sign in to comment.