Skip to content

Commit

Permalink
DB Refactoring fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoRogai committed Sep 4, 2024
1 parent 5f18a96 commit 4507a86
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions RepHub.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,18 @@ function RepHub:RefreshReputationGlobalDB()
end
end

local standings = {}
if self.db.global.ReputationList[factionData.factionID] then
standings = self.db.global.ReputationList[factionData.factionID].standings or {}
if not self.db.global.ReputationList[factionData.factionID] then
self.db.global.ReputationList[factionData.factionID] = {
["name"] = factionData.name,
["currentGroup"] = currentGroup,
["isHeader"] = factionData.isHeader,
["isHeaderWithRep"] = factionData.isHeaderWithRep,
["isAccountWide"] = factionData.isAccountWide,
["standings"] = {}
}
end

standings[characterName] = factionData.currentStanding

self.db.global.ReputationList[factionData.factionID] = {
["name"] = factionData.name,
["currentGroup"] = currentGroup,
["isHeader"] = factionData.isHeader,
["isHeaderWithRep"] = factionData.isHeaderWithRep,
["isAccountWide"] = factionData.isAccountWide,
["standings"] = standings
}
self.db.global.ReputationList[factionData.factionID].standings[characterName] = factionData.currentStanding

factionIndex = factionIndex + 1
end
Expand Down

0 comments on commit 4507a86

Please sign in to comment.