mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-13 03:32:28 -04:00
Core/Transmog: Fix crash happening when trying to apply artifact override transmog to characters still in Initial spec
Closes #31749
This commit is contained in:
@@ -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<TransmogOutfitSlotOption>(AsUnderlyingType(TransmogOutfitSlotOption::ArtifactSpecOne) + GetPrimarySpecializationEntry()->OrderIndex);
|
||||
TransmogMgr::TransmogOutfitSlotAndOptionInfo const* artifactSlotInfo = TransmogMgr::GetSlotAndOption(EquipmentSlots(slot), artifactOption);
|
||||
if (artifactSlotInfo && static_cast<TransmogOutfitDisplayType>(*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<TransmogOutfitSlotOption>(AsUnderlyingType(TransmogOutfitSlotOption::ArtifactSpecOne) + specIndex);
|
||||
TransmogMgr::TransmogOutfitSlotAndOptionInfo const* artifactSlotInfo = TransmogMgr::GetSlotAndOption(EquipmentSlots(slot), artifactOption);
|
||||
if (artifactSlotInfo && static_cast<TransmogOutfitDisplayType>(*m_activePlayerData->ViewedOutfit->Slots[artifactSlotInfo->SlotIndex].AppearanceDisplayType) == TransmogOutfitDisplayType::Assigned)
|
||||
{
|
||||
transmogSlotOption = artifactOption;
|
||||
slotInfo = artifactSlotInfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user