diff --git a/info.json b/info.json index 13b753a9..baf09a8d 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "stdlib", - "version": "1.0.6", + "version": "1.0.7", "factorio_version": "0.17", "title": "Factorio Standard Library", "author": "Afforess", diff --git a/stdlib/event/changes.lua b/stdlib/event/changes.lua index aad37409..095e622c 100644 --- a/stdlib/event/changes.lua +++ b/stdlib/event/changes.lua @@ -109,15 +109,17 @@ function Changes.on_mod_changed(this_mod_changes) local old = this_mod_changes.old_version if old then -- Find the last installed version + local vers = {} for _, path in pairs(Changes.mod_versions) do for ver, func in pairs(path) do if not global._changes[ver] then - run_if_exists(func) - global._changes[ver] = old + vers[ver] = this_mod_changes.new_version + func() log('Migration completed for version ' .. ver) end end end + table.each(vers, function(v, k) global._changes[k] = v end) end end