diff --git a/changelog.txt b/changelog.txt index 344b4075..2dc93291 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,9 @@ --------------------------------------------------------------------------------------------------- +Version: 2.1.14 +Date: ??? + Changes: + - Fixed that choosing a T.U.R.D. gave an error on new save files +--------------------------------------------------------------------------------------------------- Version: 2.1.13 Date: 2024-1-8 Changes: diff --git a/migrations/2.1.14.lua b/migrations/2.1.14.lua new file mode 100644 index 00000000..b5bca185 --- /dev/null +++ b/migrations/2.1.14.lua @@ -0,0 +1 @@ +global.turd_migrations = global.turd_migrations or {} \ No newline at end of file diff --git a/scripts/turd/turd.lua b/scripts/turd/turd.lua index 05f7c2cc..c199f0be 100644 --- a/scripts/turd/turd.lua +++ b/scripts/turd/turd.lua @@ -50,7 +50,7 @@ local function on_search(search_key, gui, player) end local function has_turd_migration(force_index, sub_tech_name) - return game.tick < (global.turd_migrations[force_index][sub_tech_name] or 0) + return game.tick < ((global.turd_migrations[force_index] or {})[sub_tech_name] or 0) end local function update_confirm_button(element, player, researched_technologies) @@ -490,6 +490,7 @@ Turd.events.on_init = function() global.turd_views = global.turd_views or {} global.turd_reset_remaining = global.turd_reset_remaining or {} global.turd_machine_replacements = global.turd_machine_replacements or {} + global.turd_migrations = global.turd_migrations or {} end local function starts_with(str, start)