diff options
author | Shauren <shauren.trinity@gmail.com> | 2025-05-24 22:12:32 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2025-05-24 22:12:32 +0200 |
commit | 1a5af00760e8ba96a01c0e9049cca9de30ded567 (patch) | |
tree | 4ded80f5200eae163e26e669c54b783c87c2ccc8 /src | |
parent | 5c5a047342b417a8363765a7b174fdf1c9f8bd5a (diff) |
Core/Players: Unbreak dual wield
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 739d19806bd..4919eb8c781 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -23528,15 +23528,21 @@ void Player::AutoUnequipOffhandIfNeed(bool force /*= false*/) if (!offItem) return; + ItemTemplate const* offhandTemplate = offItem->GetTemplate(); + // unequip offhand weapon if player doesn't have dual wield anymore - if (!CanDualWield() && (offItem->GetTemplate()->InventoryType == INVTYPE_WEAPONOFFHAND || offItem->GetTemplate()->InventoryType == INVTYPE_WEAPON)) + if (!CanDualWield() && (offhandTemplate->InventoryType == INVTYPE_WEAPONOFFHAND || offhandTemplate->InventoryType == INVTYPE_WEAPON)) force = true; // need unequip offhand for 2h-weapon without TitanGrip (in any from hands) - if (!force && CanTitanGrip(offItem)) + if (!force) { Item* mainItem = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND); - if (!mainItem || CanTitanGrip(mainItem)) + if ((!mainItem || mainItem->GetTemplate()->InventoryType != INVTYPE_2HWEAPON) + && offhandTemplate->InventoryType != INVTYPE_2HWEAPON) + return; + + if ((!mainItem || CanTitanGrip(mainItem)) && CanTitanGrip(offItem)) return; } |