From 148f63cffeddde53d9a5bbfa1fb2f638c4598c97 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sat, 14 Feb 2026 15:54:23 -0800 Subject: [PATCH] Fix off-by-one in ItemDisplayInfo texture component fields Texture regions are at DBC fields 15-22, not 14-21. Field 14 is HelmetGeosetVis[1] (uint32), and getString() on it returned random strings from the DBC string block, causing garbled textures on players and missing leg textures on other characters. --- Data/expansions/classic/dbc_layouts.json | 6 ++--- Data/expansions/tbc/dbc_layouts.json | 6 ++--- Data/expansions/turtle/dbc_layouts.json | 6 ++--- Data/expansions/wotlk/dbc_layouts.json | 6 ++--- src/core/application.cpp | 34 +++++++++++++----------- 5 files changed, 30 insertions(+), 28 deletions(-) diff --git a/Data/expansions/classic/dbc_layouts.json b/Data/expansions/classic/dbc_layouts.json index 0aa17c74..bcbcd27b 100644 --- a/Data/expansions/classic/dbc_layouts.json +++ b/Data/expansions/classic/dbc_layouts.json @@ -6,9 +6,9 @@ "ItemDisplayInfo": { "ID": 0, "LeftModel": 1, "LeftModelTexture": 3, "InventoryIcon": 5, "GeosetGroup1": 7, "GeosetGroup3": 9, - "TextureArmUpper": 14, "TextureArmLower": 15, "TextureHand": 16, - "TextureTorsoUpper": 17, "TextureTorsoLower": 18, - "TextureLegUpper": 19, "TextureLegLower": 20, "TextureFoot": 21 + "TextureArmUpper": 15, "TextureArmLower": 16, "TextureHand": 17, + "TextureTorsoUpper": 18, "TextureTorsoLower": 19, + "TextureLegUpper": 20, "TextureLegLower": 21, "TextureFoot": 22 }, "CharSections": { "RaceID": 1, "SexID": 2, "BaseSection": 3, diff --git a/Data/expansions/tbc/dbc_layouts.json b/Data/expansions/tbc/dbc_layouts.json index a49d1c7a..2d0ff1ae 100644 --- a/Data/expansions/tbc/dbc_layouts.json +++ b/Data/expansions/tbc/dbc_layouts.json @@ -6,9 +6,9 @@ "ItemDisplayInfo": { "ID": 0, "LeftModel": 1, "LeftModelTexture": 3, "InventoryIcon": 5, "GeosetGroup1": 7, "GeosetGroup3": 9, - "TextureArmUpper": 14, "TextureArmLower": 15, "TextureHand": 16, - "TextureTorsoUpper": 17, "TextureTorsoLower": 18, - "TextureLegUpper": 19, "TextureLegLower": 20, "TextureFoot": 21 + "TextureArmUpper": 15, "TextureArmLower": 16, "TextureHand": 17, + "TextureTorsoUpper": 18, "TextureTorsoLower": 19, + "TextureLegUpper": 20, "TextureLegLower": 21, "TextureFoot": 22 }, "CharSections": { "RaceID": 1, "SexID": 2, "BaseSection": 3, diff --git a/Data/expansions/turtle/dbc_layouts.json b/Data/expansions/turtle/dbc_layouts.json index 0aa17c74..bcbcd27b 100644 --- a/Data/expansions/turtle/dbc_layouts.json +++ b/Data/expansions/turtle/dbc_layouts.json @@ -6,9 +6,9 @@ "ItemDisplayInfo": { "ID": 0, "LeftModel": 1, "LeftModelTexture": 3, "InventoryIcon": 5, "GeosetGroup1": 7, "GeosetGroup3": 9, - "TextureArmUpper": 14, "TextureArmLower": 15, "TextureHand": 16, - "TextureTorsoUpper": 17, "TextureTorsoLower": 18, - "TextureLegUpper": 19, "TextureLegLower": 20, "TextureFoot": 21 + "TextureArmUpper": 15, "TextureArmLower": 16, "TextureHand": 17, + "TextureTorsoUpper": 18, "TextureTorsoLower": 19, + "TextureLegUpper": 20, "TextureLegLower": 21, "TextureFoot": 22 }, "CharSections": { "RaceID": 1, "SexID": 2, "BaseSection": 3, diff --git a/Data/expansions/wotlk/dbc_layouts.json b/Data/expansions/wotlk/dbc_layouts.json index 7a5271a3..4f8bc338 100644 --- a/Data/expansions/wotlk/dbc_layouts.json +++ b/Data/expansions/wotlk/dbc_layouts.json @@ -6,9 +6,9 @@ "ItemDisplayInfo": { "ID": 0, "LeftModel": 1, "LeftModelTexture": 3, "InventoryIcon": 5, "GeosetGroup1": 7, "GeosetGroup3": 9, - "TextureArmUpper": 14, "TextureArmLower": 15, "TextureHand": 16, - "TextureTorsoUpper": 17, "TextureTorsoLower": 18, - "TextureLegUpper": 19, "TextureLegLower": 20, "TextureFoot": 21 + "TextureArmUpper": 15, "TextureArmLower": 16, "TextureHand": 17, + "TextureTorsoUpper": 18, "TextureTorsoLower": 19, + "TextureLegUpper": 20, "TextureLegLower": 21, "TextureFoot": 22 }, "CharSections": { "RaceID": 1, "SexID": 2, "BaseSection": 3, diff --git a/src/core/application.cpp b/src/core/application.cpp index bc403754..58f2927a 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -3130,15 +3130,16 @@ void Application::spawnOnlineCreature(uint64_t guid, uint32_t displayId, float x const auto* idiL = pipeline::getActiveDBCLayout() ? pipeline::getActiveDBCLayout()->getLayout("ItemDisplayInfo") : nullptr; // Texture component region fields (8 regions: ArmUpper..Foot) + // Fields 15-22 in WotLK ItemDisplayInfo.dbc (field 14 = HelmetGeosetVis[1]) const uint32_t texRegionFields[8] = { - idiL ? (*idiL)["TextureArmUpper"] : 14u, - idiL ? (*idiL)["TextureArmLower"] : 15u, - idiL ? (*idiL)["TextureHand"] : 16u, - idiL ? (*idiL)["TextureTorsoUpper"]: 17u, - idiL ? (*idiL)["TextureTorsoLower"]: 18u, - idiL ? (*idiL)["TextureLegUpper"] : 19u, - idiL ? (*idiL)["TextureLegLower"] : 20u, - idiL ? (*idiL)["TextureFoot"] : 21u, + idiL ? (*idiL)["TextureArmUpper"] : 15u, + idiL ? (*idiL)["TextureArmLower"] : 16u, + idiL ? (*idiL)["TextureHand"] : 17u, + idiL ? (*idiL)["TextureTorsoUpper"]: 18u, + idiL ? (*idiL)["TextureTorsoLower"]: 19u, + idiL ? (*idiL)["TextureLegUpper"] : 20u, + idiL ? (*idiL)["TextureLegLower"] : 21u, + idiL ? (*idiL)["TextureFoot"] : 22u, }; const bool npcIsFemale = (extra.sexId == 1); @@ -3969,15 +3970,16 @@ void Application::setOnlinePlayerEquipment(uint64_t guid, }; // Texture component region fields from DBC layout + // Fields 15-22 in WotLK ItemDisplayInfo.dbc (field 14 = HelmetGeosetVis[1]) const uint32_t texRegionFields[8] = { - idiL ? (*idiL)["TextureArmUpper"] : 14u, - idiL ? (*idiL)["TextureArmLower"] : 15u, - idiL ? (*idiL)["TextureHand"] : 16u, - idiL ? (*idiL)["TextureTorsoUpper"]: 17u, - idiL ? (*idiL)["TextureTorsoLower"]: 18u, - idiL ? (*idiL)["TextureLegUpper"] : 19u, - idiL ? (*idiL)["TextureLegLower"] : 20u, - idiL ? (*idiL)["TextureFoot"] : 21u, + idiL ? (*idiL)["TextureArmUpper"] : 15u, + idiL ? (*idiL)["TextureArmLower"] : 16u, + idiL ? (*idiL)["TextureHand"] : 17u, + idiL ? (*idiL)["TextureTorsoUpper"]: 18u, + idiL ? (*idiL)["TextureTorsoLower"]: 19u, + idiL ? (*idiL)["TextureLegUpper"] : 20u, + idiL ? (*idiL)["TextureLegLower"] : 21u, + idiL ? (*idiL)["TextureFoot"] : 22u, }; std::vector> regionLayers;