Skip to content

Save the reputations table on Classic Era, and skip factions absent from the running version - #16

Open
uga wants to merge 2 commits into
Thaoky:developmentfrom
uga:fix/classic-era-saved-variables
Open

Save the reputations table on Classic Era, and skip factions absent from the running version#16
uga wants to merge 2 commits into
Thaoky:developmentfrom
uga:fix/classic-era-saved-variables

Conversation

@uga

@uga uga commented Aug 1, 2026

Copy link
Copy Markdown

Summary

Two fixes in DataStore_Reputations. Verified in game on Classic Era and TBC Anniversary.


1. Save the reputations table on Classic Era

DataStore_Reputations_Vanilla.toc still declared the old AceDB object:

## SavedVariables: DataStore_ReputationsDB

The module writes DataStore_Reputations_Characters, which was not declared, so on Classic Era nothing was ever persisted: reputations were rescanned from scratch every session and no alt ever had any. The other TOCs already declare the current table.

2. Skip factions that do not exist in the running version of the game

Registering a faction whose id is absent from the running version indexed factionNameToId with nil, which errors. Those ids are now skipped.


Applicability

Fix Classic Era TBC Anniversary
Vanilla TOC saved variables yes, Classic Era only no, its TOC was already correct
Factions absent from the running version yes yes

The reputation grid in Altoholic_Cata has a companion change in the linked PR.


Related PRs

This is one change set spread over the repos it touches. Account sharing needs the first two together; the others are independent of each other.

Uga and others added 2 commits August 1, 2026 20:08
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant