fix: restore correct CharSections.dbc field indices for character textures

PR #19 (572bb4ef) swapped CharSections.dbc field indices, placing
Texture1-3 at fields 4-6 and VariationIndex/ColorIndex at 8-9. Binary
analysis of the actual DBC files (Classic, TBC, Turtle — all identical
layout, no WotLK-specific override) confirms the correct order is:

  Field 4 = VariationIndex
  Field 5 = ColorIndex
  Field 6 = Texture1 (string)
  Field 7 = Texture2 (string)
  Field 8 = Texture3 (string)
  Field 9 = Flags

With the wrong indices, VariationIndex/ColorIndex reads returned string
offsets (garbage values that never matched), so all CharSections lookups
failed silently — producing white untextured character models at the
login screen and in-world.

Fixes all 4 expansion JSON layouts, hardcoded fallbacks in
character_preview.cpp, application.cpp, and character_create_screen.cpp.
Also handles the single-layer edge case (body skin only, no face/underwear)
by loading the texture directly instead of skipping compositing.
This commit is contained in:
Kelsi 2026-03-22 15:22:25 -07:00
parent 329a1f4b12
commit e9ce062112
7 changed files with 49 additions and 38 deletions

View file

@ -37,12 +37,12 @@
"RaceID": 1,
"SexID": 2,
"BaseSection": 3,
"Texture1": 4,
"Texture2": 5,
"Texture3": 6,
"Flags": 7,
"VariationIndex": 8,
"ColorIndex": 9
"VariationIndex": 4,
"ColorIndex": 5,
"Texture1": 6,
"Texture2": 7,
"Texture3": 8,
"Flags": 9
},
"SpellIcon": {
"ID": 0,