mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Update EquipAction.cpp
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user