From 1c454429f76a76b1f8b78967502261e84c4fad3d Mon Sep 17 00:00:00 2001 From: Uga Date: Sat, 1 Aug 2026 20:08:55 +0200 Subject: [PATCH 1/2] Skip factions that do not exist in the running version of the game The reputations grid builds its rows from DataStore:GetFactionName(id), which returns nil for a faction the current version never registered. Tranquillien is one: it is only added from The Burning Crusade onwards, so on Classic Era its row carries an icon and no name. Picking "All in one" then sorts those rows and compares a nil name with a string. Nameless factions are now left out of the view entirely - there is nothing to show for them - in the per-group views too, where they rendered as blank rows. The two leftover debug prints in the comparator go with them. AddFaction() had the mirror of the same problem: given a name it cannot resolve, it wrote factionNameToId[nil], which errors and would take out every faction declared after it. It now skips the faction instead, and RemoveFaction() no longer assumes the faction it clears was registered. Co-Authored-By: Claude Opus 5 --- DataStore_Reputations/DataStore_Reputations.lua | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/DataStore_Reputations/DataStore_Reputations.lua b/DataStore_Reputations/DataStore_Reputations.lua index a1f7570..1dd11db 100644 --- a/DataStore_Reputations/DataStore_Reputations.lua +++ b/DataStore_Reputations/DataStore_Reputations.lua @@ -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"]) From aac6465bfbac604d251ca55b54e1f6ab179f9a2c Mon Sep 17 00:00:00 2001 From: Uga Date: Sat, 1 Aug 2026 20:11:32 +0200 Subject: [PATCH 2/2] Save the reputations table on Classic Era DataStore_Reputations_Vanilla.toc declared DataStore_ReputationsDB as its saved variable - the AceDB object from before the migration, which no code touches any more. The table the module actually writes to, DataStore_Reputations_Characters, was never persisted, so it came back empty every session with a single entry: the row GetCharacterDB() creates for the character logging in. Every alt's reputation disappeared at logout, which is why the grid only ever had one populated column, and why the column followed whichever character was logged in. The three other tocs of the module already name the right table. Co-Authored-By: Claude Opus 5 --- DataStore_Reputations/DataStore_Reputations_Vanilla.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DataStore_Reputations/DataStore_Reputations_Vanilla.toc b/DataStore_Reputations/DataStore_Reputations_Vanilla.toc index b0bbdaf..88be79f 100644 --- a/DataStore_Reputations/DataStore_Reputations_Vanilla.toc +++ b/DataStore_Reputations/DataStore_Reputations_Vanilla.toc @@ -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