diff --git a/CHANGELOG.md b/CHANGELOG.md index 0637d800..aeb3682f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ Version 1.2.3 character, and trying to count the non-existant quick bar slots. - Fixed inventoryImport never receiving the script output after the default mode for reading script output changed to tail mode. +- Fixed desync caused by the mods and loaded mods arrays in Hotpatch getting + out of sync when plugins update their scenario mod code. To fix existing + games you will need copy lib/scenarios/Hotpatch/hotpatch/mod-tools.lua + over the existing mod-tools.lua in the save's hotpatch folder. Version 1.2.2 diff --git a/lib/scenarios/Hotpatch/hotpatch/mod-tools.lua b/lib/scenarios/Hotpatch/hotpatch/mod-tools.lua index 91c46776..b0485900 100644 --- a/lib/scenarios/Hotpatch/hotpatch/mod-tools.lua +++ b/lib/scenarios/Hotpatch/hotpatch/mod-tools.lua @@ -461,8 +461,9 @@ install_mod = function(mod_name, mod_version, mod_code, mod_files) local index = find_installed_mod(mod_name) local mod = {} if index then - -- TODO: notify about installing over top of existing mod - mod = global.mods[index] + debug_log('attempt to install mod that is already installed, reinstalling: ' .. mod_name) + mod = table.remove(global.mods, index) + table.insert(global.mods, mod) else --next free index table.insert(global.mods, mod)