diff --git a/src/glue/CharacterSelectionDisplay.cpp b/src/glue/CharacterSelectionDisplay.cpp index 3c0ceb9..13affcb 100644 --- a/src/glue/CharacterSelectionDisplay.cpp +++ b/src/glue/CharacterSelectionDisplay.cpp @@ -43,6 +43,93 @@ void CharacterSelectionDisplay::CreateModelData() { 1 ); + for (int32_t invSlot = INVSLOT_FIRST; invSlot < NUM_INVENTORY_SLOTS; invSlot++) { + auto displayID = this->m_info.inventoryItemDisplayID[invSlot]; + auto visualID = this->m_info.inventoryItemVisualID[invSlot]; + + // Only honor ranged slot for hunters + if (invSlot == INVSLOT_RANGED && displayID && this->m_info.classID != 3) { + continue; + } + + if (invSlot == INVSLOT_HEAD && (this->m_info.flags & 0x400)) { + continue; + } + + if (invSlot == INVSLOT_BACK && (this->m_info.flags & 0x800)) { + continue; + } + + auto displayRec = g_itemDisplayInfoDB.GetRecord(displayID); + + if (!displayRec) { + continue; + } + + // Item visuals in database override item visuals in character info + if (g_itemVisualsDB.GetRecord(displayRec->m_itemVisual)) { + visualID = 0; + } + + // Bags + + if (invSlot >= INVSLOT_BAGFIRST) { + if (*displayRec->m_modelName[0]) { + this->m_component->AddItem(ITEMSLOT_11, displayRec, 0); + } + + continue; + } + + // Main hand and off hand + + if (invSlot == INVSLOT_MAINHAND || invSlot == INVSLOT_OFFHAND) { + CCharacterComponent::AddHandItem( + this->m_component->m_data.model, + displayRec, + static_cast(invSlot), + SHEATHE_0, + false, + this->m_info.inventoryItemType[invSlot] == 14, + false, + visualID + ); + + continue; + } + + // Ranged + + if (invSlot == INVSLOT_RANGED) { + CCharacterComponent::AddHandItem( + this->m_component->m_data.model, + displayRec, + static_cast(invSlot), + SHEATHE_0, + false, + this->m_info.inventoryItemType[invSlot] == 14, + false, + visualID + ); + + // TODO + + continue; + } + + // Tabard + + if (invSlot == INVSLOT_TABARD) { + // TODO + + continue; + } + + // All other slots + + this->m_component->AddItemBySlot(static_cast(invSlot), displayID, visualID); + } + // TODO load pet model CCharacterSelection::s_characterCount++;