Fix action bar spell icons missing on Turtle WoW

Turtle/Classic Spell.csv files are garbled (field 0 is a string rather
than a numeric ID) so loadDBC() falls back to the WotLK binary Spell.dbc
(234 fields). getSpellIcon() was still using the Turtle layout (IconID at
field 117) to read the WotLK binary, producing garbage values and no icons.

When the loaded Spell.dbc has >=200 fields it is the WotLK binary; use the
WotLK IconID field (133) directly, matching the same approach already used
in spellbook_screen.cpp.
This commit is contained in:
Kelsi 2026-02-17 14:55:32 -08:00
parent 7cf060a9f6
commit 42e7e1ce7e

View file

@ -2986,7 +2986,12 @@ GLuint GameScreen::getSpellIcon(uint32_t spellId, pipeline::AssetManager* am) {
}
}
};
if (spellL) {
// If the DBC has WotLK-range field count (≥200 fields), it's the binary
// WotLK Spell.dbc (CSV fallback). Use WotLK layout regardless of expansion,
// since Turtle/Classic CSV files are garbled and fall back to WotLK binary.
if (fieldCount >= 200) {
tryLoadIcons(0, 133); // WotLK IconID field
} else if (spellL) {
tryLoadIcons((*spellL)["ID"], (*spellL)["IconID"]);
}
// Fallback to WotLK field 133 if expansion layout yielded nothing