mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Items: Minor changes to transmog checks - only use ItemTransmogrificationSlots for armor, weapons are checked separately anyway
This commit is contained in:
@@ -1744,7 +1744,7 @@ int32 const ItemTransmogrificationSlots[MAX_INVTYPE] =
|
||||
{
|
||||
-1, // INVTYPE_NON_EQUIP
|
||||
EQUIPMENT_SLOT_HEAD, // INVTYPE_HEAD
|
||||
EQUIPMENT_SLOT_NECK, // INVTYPE_NECK
|
||||
-1, // INVTYPE_NECK
|
||||
EQUIPMENT_SLOT_SHOULDERS, // INVTYPE_SHOULDERS
|
||||
EQUIPMENT_SLOT_BODY, // INVTYPE_BODY
|
||||
EQUIPMENT_SLOT_CHEST, // INVTYPE_CHEST
|
||||
@@ -1755,19 +1755,19 @@ int32 const ItemTransmogrificationSlots[MAX_INVTYPE] =
|
||||
EQUIPMENT_SLOT_HANDS, // INVTYPE_HANDS
|
||||
-1, // INVTYPE_FINGER
|
||||
-1, // INVTYPE_TRINKET
|
||||
-1, // INVTYPE_WEAPON
|
||||
EQUIPMENT_SLOT_MAINHAND, // INVTYPE_WEAPON
|
||||
EQUIPMENT_SLOT_OFFHAND, // INVTYPE_SHIELD
|
||||
EQUIPMENT_SLOT_MAINHAND, // INVTYPE_RANGED
|
||||
EQUIPMENT_SLOT_BACK, // INVTYPE_CLOAK
|
||||
-1, // INVTYPE_2HWEAPON
|
||||
EQUIPMENT_SLOT_MAINHAND, // INVTYPE_2HWEAPON
|
||||
-1, // INVTYPE_BAG
|
||||
EQUIPMENT_SLOT_TABARD, // INVTYPE_TABARD
|
||||
EQUIPMENT_SLOT_CHEST, // INVTYPE_ROBE
|
||||
EQUIPMENT_SLOT_MAINHAND, // INVTYPE_WEAPONMAINHAND
|
||||
EQUIPMENT_SLOT_OFFHAND, // INVTYPE_WEAPONOFFHAND
|
||||
EQUIPMENT_SLOT_MAINHAND, // INVTYPE_WEAPONOFFHAND
|
||||
EQUIPMENT_SLOT_OFFHAND, // INVTYPE_HOLDABLE
|
||||
-1, // INVTYPE_AMMO
|
||||
EQUIPMENT_SLOT_MAINHAND, // INVTYPE_THROWN
|
||||
-1, // INVTYPE_THROWN
|
||||
EQUIPMENT_SLOT_MAINHAND, // INVTYPE_RANGEDRIGHT
|
||||
-1, // INVTYPE_QUIVER
|
||||
-1 // INVTYPE_RELIC
|
||||
@@ -1809,22 +1809,15 @@ bool Item::CanTransmogrifyItemWithItem(Item const* item, ItemModifiedAppearanceE
|
||||
case ITEM_CLASS_ARMOR:
|
||||
if (source->GetSubClass() != ITEM_SUBCLASS_ARMOR_COSMETIC)
|
||||
return false;
|
||||
if (source->GetInventoryType() != target->GetInventoryType())
|
||||
if (ItemTransmogrificationSlots[source->GetInventoryType()] != ItemTransmogrificationSlots[target->GetInventoryType()])
|
||||
return false;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (source->GetInventoryType() != target->GetInventoryType())
|
||||
{
|
||||
int32 sourceSlot = ItemTransmogrificationSlots[source->GetInventoryType()];
|
||||
if (sourceSlot == -1 && source->GetInventoryType() == INVTYPE_WEAPON && (target->GetInventoryType() == INVTYPE_WEAPONMAINHAND || target->GetInventoryType() == INVTYPE_WEAPONOFFHAND))
|
||||
sourceSlot = ItemTransmogrificationSlots[target->GetInventoryType()];
|
||||
|
||||
if (sourceSlot != ItemTransmogrificationSlots[target->GetInventoryType()])
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -70,6 +70,7 @@ enum ItemUpdateState
|
||||
bool ItemCanGoIntoBag(ItemTemplate const* proto, ItemTemplate const* pBagProto);
|
||||
extern ItemModifier const AppearanceModifierSlotBySpec[MAX_SPECIALIZATIONS];
|
||||
extern ItemModifier const IllusionModifierSlotBySpec[MAX_SPECIALIZATIONS];
|
||||
extern int32 const ItemTransmogrificationSlots[MAX_INVTYPE];
|
||||
|
||||
struct BonusData
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user