moved migration logic into manager

This commit is contained in:
mamoniot
2023-05-01 06:26:20 -04:00
parent e20ef82eb5
commit 59eb580eb5
4 changed files with 12 additions and 17 deletions

View File

@@ -4,6 +4,7 @@ Date: 2023-4-30
Bugfixes:
- Fixed UPS spikes in Space Exploration related to expensive remote calls into their modding interface.
- Fixed missing cybersyn manager translation key.
- Added a fix for a crash related to using the beta branch of cybersyn
---------------------------------------------------------------------------------------------------
Version: 1.2.14
Date: 2023-4-30

View File

@@ -3,4 +3,4 @@
--- It is used in migrations.lua to determine if any migrations need to be run for beta testers.
--- It is expected these are only meaningful between releases during beta testing.
--- It should be set to nil for any release version.
return 2
return nil

View File

@@ -147,7 +147,14 @@ end
function manager_gui.on_migration()
init_items(global.manager)
if global.manager then
for i, v in pairs(global.manager.players) do
manager_gui.reset_player(i, v)
end
init_items(global.manager)
else
manager_gui.on_init()
end
end
function manager_gui.on_init()

View File

@@ -328,19 +328,6 @@ function on_config_changed(data)
global.tick_data = {}
global.perf_cache = {}
if global.manager then
for i, v in pairs(global.manager.players) do
manager_gui.reset_player(i, v)
end
else
global.manager = {
players = {},
}
for i, v in pairs(game.players) do
manager_gui.on_player_created({player_index = i})
end
end
flib_migration.on_config_changed(data, migrations_table)
IS_SE_PRESENT = remote.interfaces["space-exploration"] ~= nil