From 39508901591610f648120875e7d99ca4585f316c Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 24 Mar 2026 19:15:43 +0100 Subject: [PATCH] Core/Transmog: Fix crash happening when trying to apply artifact override transmog to characters still in Initial spec Closes #31749 --- src/server/game/Entities/Player/Player.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 0c79db078f..8faf742742 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -11878,12 +11878,17 @@ void Player::SetVisibleItemSlot(uint8 slot, Item const* item) if (transmogSlotOption != TransmogOutfitSlotOption::None) { // check if artifact override is active - TransmogOutfitSlotOption artifactOption = static_cast(AsUnderlyingType(TransmogOutfitSlotOption::ArtifactSpecOne) + GetPrimarySpecializationEntry()->OrderIndex); - TransmogMgr::TransmogOutfitSlotAndOptionInfo const* artifactSlotInfo = TransmogMgr::GetSlotAndOption(EquipmentSlots(slot), artifactOption); - if (artifactSlotInfo && static_cast(*m_activePlayerData->ViewedOutfit->Slots[artifactSlotInfo->SlotIndex].AppearanceDisplayType) == TransmogOutfitDisplayType::Assigned) + static constexpr int32 MaxArtifactSpecializations = AsUnderlyingType(TransmogOutfitSlotOption::ArtifactSpecFour) - AsUnderlyingType(TransmogOutfitSlotOption::ArtifactSpecOne) + 1; + int32 specIndex = GetPrimarySpecializationEntry()->OrderIndex; + if (specIndex >= 0 && specIndex < MaxArtifactSpecializations) { - transmogSlotOption = artifactOption; - slotInfo = artifactSlotInfo; + TransmogOutfitSlotOption artifactOption = static_cast(AsUnderlyingType(TransmogOutfitSlotOption::ArtifactSpecOne) + specIndex); + TransmogMgr::TransmogOutfitSlotAndOptionInfo const* artifactSlotInfo = TransmogMgr::GetSlotAndOption(EquipmentSlots(slot), artifactOption); + if (artifactSlotInfo && static_cast(*m_activePlayerData->ViewedOutfit->Slots[artifactSlotInfo->SlotIndex].AppearanceDisplayType) == TransmogOutfitDisplayType::Assigned) + { + transmogSlotOption = artifactOption; + slotInfo = artifactSlotInfo; + } } }