Update EquipAction.cpp

This commit is contained in:
avirar
2024-12-14 18:07:02 +11:00
committed by GitHub
parent ea9bd18102
commit a9eb41600d

View File

@@ -154,7 +154,7 @@ void EquipAction::EquipItem(Item* item)
(mhProto->InventoryType == INVTYPE_2HWEAPON && mhIsValidTG));
}
// If new weapon is best of all three, put it in main hand
// If new weapon is best of all three, put it in main hand// If new weapon is best of all three, put it in main hand
if (newIsBest && canGoMain)
{
// Equip new weapon in main hand
@@ -185,6 +185,15 @@ void EquipAction::EquipItem(Item* item)
}
else if (betterThanOff && canGoOff)
{
// If offhand is empty, just verify logic:
// Since newIsBest is false, the main hand is already equal or better than the new weapon.
// Thus, equipping this weapon in offhand is safe and correct.
if (!offHandItem)
{
// No additional main hand check needed because if it were better than main hand,
// newIsBest would have triggered above.
}
// Equip the new weapon in offhand
WorldPacket eqPacket(CMSG_AUTOEQUIP_ITEM_SLOT, 2);
ObjectGuid newItemGuid = item->GetGUID();