Skip to content

Commit

Permalink
Found some legacy code that didn't reference the DB correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vapok committed Jun 30, 2020
1 parent b1d3d9e commit 88b75cf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Modules/Validate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,12 @@ function CommDKP_ReindexTables()
end

i=1

while i <= #CommDKP:GetTable(CommDKP_DKPHistory, true) do
if CommDKP:GetTable(CommDKP_DKPHistory, true)[i].deletes or CommDKP:GetTable(CommDKP_DKPHistory, true)[i].deletedby or CommDKP:GetTable(CommDKP_DKPHistory, true)[i].reason == "Migration Correction" then
table.remove(CommDKP:GetTable(CommDKP_DKPHistory, true), i)
else
if (CommDKP_DB.defaults.installed and CommDKP:GetTable(CommDKP_DKPHistory, true)[i].date < CommDKP_DB.defaults.installed) or (not CommDKP_DB.defaults.installed and CommDKP:GetTable(CommDKP_DKPHistory, true)[i].date < CommDKP_DB.defaults.installed210) then
if (core.DB.defaults.installed and CommDKP:GetTable(CommDKP_DKPHistory, true)[i].date < core.DB.defaults.installed) or (not core.DB.defaults.installed and CommDKP:GetTable(CommDKP_DKPHistory, true)[i].date < core.DB.defaults.installed210) then
CommDKP:GetTable(CommDKP_DKPHistory, true)[i].index = GM.."-"..CommDKP:GetTable(CommDKP_DKPHistory, true)[i].date -- reindexes under GMs name if the entry was created prior to 2.1 (for uniformity)
end
i=i+1
Expand All @@ -294,7 +295,7 @@ function CommDKP_ReindexTables()
if CommDKP:GetTable(CommDKP_Loot, true)[i].deletes or CommDKP:GetTable(CommDKP_Loot, true)[i].deletedby then
table.remove(CommDKP:GetTable(CommDKP_Loot, true), i)
else
if (CommDKP_DB.defaults.installed and CommDKP:GetTable(CommDKP_Loot, true)[i].date < CommDKP_DB.defaults.installed) or (not CommDKP_DB.defaults.installed and CommDKP:GetTable(CommDKP_Loot, true)[i].date < CommDKP_DB.defaults.installed210) then
if (core.DB.defaults.installed and CommDKP:GetTable(CommDKP_Loot, true)[i].date < core.DB.defaults.installed) or (not core.DB.defaults.installed and CommDKP:GetTable(CommDKP_Loot, true)[i].date < core.DB.defaults.installed210) then
CommDKP:GetTable(CommDKP_Loot, true)[i].index = GM.."-"..CommDKP:GetTable(CommDKP_Loot, true)[i].date -- reindexes under GMs name if the entry was created prior to 2.1 (for uniformity)
end
i=i+1
Expand Down

0 comments on commit 88b75cf

Please sign in to comment.