Skip to content

Commit

Permalink
Another changes typo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Nexela committed May 26, 2019
1 parent 80b8d7f commit 5a81917
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stdlib",
"version": "1.0.5",
"version": "1.0.6",
"factorio_version": "0.17",
"title": "Factorio Standard Library",
"author": "Afforess",
Expand Down
21 changes: 9 additions & 12 deletions stdlib/event/changes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ setmetatable(Changes, require('__stdlib__/stdlib/core'))
old_version :: string: Old version of the mod. May be nil if the mod wasn't previously present (i.e. it was just added).
new_version :: string: New version of the mod. May be nil if the mod is no longer present (i.e. it was just removed).
--]]

local table = require('__stdlib__/stdlib/utils/table')

local map_changes = {
Expand Down Expand Up @@ -106,18 +105,16 @@ function Changes.on_configuration_changed(event)
end

function Changes.on_mod_changed(this_mod_changes)
if Changes.mod_versions then
global._changes = global._changes or {}
global._changes = global._changes or {}

local old = this_mod_changes.old_version
if old then -- Find the last installed version
for _, path in pairs(Changes.versions) do
for ver, func in pairs(path) do
if not global._changes[ver] then
run_if_exists(func)
global._changes[ver] = old
log('Migration completed for version ' .. ver)
end
local old = this_mod_changes.old_version
if old then -- Find the last installed version
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
log('Migration completed for version ' .. ver)
end
end
end
Expand Down

0 comments on commit 5a81917

Please sign in to comment.