Skip to content

Commit

Permalink
Fixed that choosing a T.U.R.D. gave an error on new save files
Browse files Browse the repository at this point in the history
  • Loading branch information
Septiple committed Jan 9, 2024
1 parent 5b91dda commit 1c895ac
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
1 change: 1 addition & 0 deletions migrations/2.1.14.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
global.turd_migrations = global.turd_migrations or {}
3 changes: 2 additions & 1 deletion scripts/turd/turd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 1c895ac

Please sign in to comment.