From de8c195eaff2f3b827b081535fea614609d3de8f Mon Sep 17 00:00:00 2001 From: Kelsi Date: Thu, 5 Feb 2026 15:07:31 -0800 Subject: [PATCH] Fix CharSections.dbc lookup for skin color variations For Section 0 (body skin) and Section 4 (underwear), the skin color is stored in colorIndex with variation=0, not the other way around. This fixes the preview showing no texture for skin colors other than 0. --- src/rendering/character_preview.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rendering/character_preview.cpp b/src/rendering/character_preview.cpp index a409b8e8..96ac1a23 100644 --- a/src/rendering/character_preview.cpp +++ b/src/rendering/character_preview.cpp @@ -172,9 +172,9 @@ bool CharacterPreview::loadCharacter(game::Race race, game::Gender gender, if (raceId != targetRaceId || sexId != targetSexId) continue; - // Section 0: Body skin (variation = skin color, colorIndex = 0) + // Section 0: Body skin (variation=0, colorIndex = skin color) if (baseSection == 0 && !foundSkin && - variationIndex == static_cast(skin) && colorIndex == 0) { + variationIndex == 0 && colorIndex == static_cast(skin)) { std::string tex1 = charSectionsDbc->getString(r, 4); if (!tex1.empty()) { bodySkinPath = tex1; @@ -201,9 +201,9 @@ bool CharacterPreview::loadCharacter(game::Race race, game::Gender gender, foundHair = true; } } - // Section 4: Underwear (variation = skin color, colorIndex = 0) + // Section 4: Underwear (variation=0, colorIndex = skin color) else if (baseSection == 4 && !foundUnderwear && - variationIndex == static_cast(skin) && colorIndex == 0) { + variationIndex == 0 && colorIndex == static_cast(skin)) { for (int f = 4; f <= 6; f++) { std::string tex = charSectionsDbc->getString(r, f); if (!tex.empty()) {