fix: enable Classic/Turtle Spell.dbc loading and add WotLK optional spell fields to layout

Lower fieldCount threshold from 154→148 so Classic 1.12 and Turtle WoW Spell.dbc
(148 fields, Tooltip at index 147) are accepted by the spellbook loader instead of
being silently skipped.

Add PowerType/ManaCost/CastingTimeIndex/RangeIndex to the WotLK dbc_layouts.json
Spell section so mana cost, cast time, and range continue to display correctly when
the DBC layout path is active (the old hardcoded-index fallback path is now bypassed
since layout-path loads spell names first and spellData.empty() is no longer true).
This commit is contained in:
Kelsi 2026-03-10 17:53:17 -07:00
parent fcb133dbbe
commit 2f3f9f1a21
2 changed files with 6 additions and 3 deletions

View file

@ -1,7 +1,8 @@
{
"Spell": {
"ID": 0, "Attributes": 4, "IconID": 133,
"Name": 136, "Tooltip": 139, "Rank": 153, "SchoolMask": 225
"Name": 136, "Tooltip": 139, "Rank": 153, "SchoolMask": 225,
"PowerType": 14, "ManaCost": 39, "CastingTimeIndex": 47, "RangeIndex": 49
},
"ItemDisplayInfo": {
"ID": 0, "LeftModel": 1, "LeftModelTexture": 3,

View file

@ -45,8 +45,10 @@ void SpellbookScreen::loadSpellDBC(pipeline::AssetManager* assetManager) {
}
uint32_t fieldCount = dbc->getFieldCount();
if (fieldCount < 154) {
LOG_WARNING("Spellbook: Spell.dbc has ", fieldCount, " fields, expected 234+");
// Classic 1.12 Spell.dbc has 148 fields (Tooltip at index 147), TBC has ~167, WotLK has 234.
// Require at least 148 fields so all expansions can load spell names/icons via the DBC layout.
if (fieldCount < 148) {
LOG_WARNING("Spellbook: Spell.dbc has ", fieldCount, " fields, too few to load");
return;
}