Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions DataStore_Reputations/DataStore_Reputations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,20 @@ do

local function AddFaction(id, text)
text = text or API_GetFactionNameByID(id)

-- a faction that does not exist in this version of the game has no name here.
-- Registering it anyway would index factionNameToId with nil, which errors out of this
-- whole block and leaves every faction declared below it unregistered.
if not text then return end

factions[id] = text

if not text then
print("no value for id : " .. id)
-- else print("Added", id, text) --debug
end
factionNameToId[text] = id
end
local function RemoveFaction(id)
factionNameToId[factions[id]] = nil
factions[id] = nil
if factions[id] then
factionNameToId[factions[id]] = nil
factions[id] = nil
end
end

AddFaction(21, BF["Booty Bay"])
Expand Down
2 changes: 1 addition & 1 deletion DataStore_Reputations/DataStore_Reputations_Vanilla.toc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
## Version: 2026.07.10
## Dependencies: DataStore
## OptionalDeps: Ace3
## SavedVariables: DataStore_ReputationsDB
## SavedVariables: DataStore_Reputations_Characters
## X-Category: Interface Enhancements
## X-Embeds: Ace3

Expand Down