aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKudlaty <none@none>2009-11-01 03:51:09 +0100
committerKudlaty <none@none>2009-11-01 03:51:09 +0100
commit425597d522284557279556f12d2f3d9834b3a346 (patch)
tree2937eb24a7c1c749f28013d1e3e7406a5b46ba8a
parent85d7084e85c1779201b025887c45c5d46e38038f (diff)
Fix exploit that Titan's Grip allow to use with it staff/polearm
--HG-- branch : trunk
-rw-r--r--src/game/Player.cpp2
-rw-r--r--src/game/Player.h10
2 files changed, 10 insertions, 2 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 5733abb630d..166bf33d26f 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -8781,7 +8781,7 @@ uint8 Player::FindEquipSlot( ItemPrototype const* proto, uint32 slot, bool swap
break;
case INVTYPE_2HWEAPON:
slots[0] = EQUIPMENT_SLOT_MAINHAND;
- if (CanDualWield() && CanTitanGrip())
+ if (CanDualWield() && CanTitanGrip() && proto && proto->SubClass != ITEM_SUBCLASS_WEAPON_POLEARM && proto->SubClass != ITEM_SUBCLASS_WEAPON_STAFF)
slots[1] = EQUIPMENT_SLOT_OFFHAND;
break;
case INVTYPE_TABARD:
diff --git a/src/game/Player.h b/src/game/Player.h
index ef9d8d30d35..244d80ec697 100644
--- a/src/game/Player.h
+++ b/src/game/Player.h
@@ -1854,7 +1854,15 @@ class MANGOS_DLL_SPEC Player : public Unit
void SetCanParry(bool value);
bool CanBlock() const { return m_canBlock; }
void SetCanBlock(bool value);
- bool CanTitanGrip() const { return m_canTitanGrip ; }
+ bool CanTitanGrip() const
+ {
+ Item *mainItem = GetItemByPos( INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND );
+
+ if (mainItem && ( mainItem->GetProto()->SubClass == ITEM_SUBCLASS_WEAPON_POLEARM || mainItem->GetProto()->SubClass == ITEM_SUBCLASS_WEAPON_STAFF ))
+ return false;
+
+ return m_canTitanGrip ;
+ }
void SetCanTitanGrip(bool value) { m_canTitanGrip = value; }
bool CanTameExoticPets() const { return isGameMaster() || HasAuraType(SPELL_AURA_ALLOW_TAME_PET_TYPE); }