aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/Player.h6
-rw-r--r--src/game/Unit.cpp4
-rw-r--r--src/game/Unit.h3
3 files changed, 10 insertions, 3 deletions
diff --git a/src/game/Player.h b/src/game/Player.h
index 10b31632415..e709e8c8169 100644
--- a/src/game/Player.h
+++ b/src/game/Player.h
@@ -1180,7 +1180,11 @@ class TRINITY_DLL_SPEC Player : public Unit
void AddArmorProficiency(uint32 newflag) { m_ArmorProficiency |= newflag; }
uint32 GetWeaponProficiency() const { return m_WeaponProficiency; }
uint32 GetArmorProficiency() const { return m_ArmorProficiency; }
- bool IsInFeralForm() const { return m_form == FORM_CAT || m_form == FORM_BEAR || m_form == FORM_DIREBEAR; }
+ bool IsUseEquipedWeapon( bool mainhand ) const
+ {
+ // disarm applied only to mainhand weapon
+ return !IsInFeralForm() && (!mainhand || !HasFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISARMED) );
+ }
bool IsTwoHandUsed() const
{
Item* mainItem = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index d957988cc05..e369c322277 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -3259,7 +3259,7 @@ uint32 Unit::GetWeaponSkillValue (WeaponAttackType attType, Unit const* target)
return 0;
}
- if(((Player*)this)->IsInFeralForm())
+ if(IsInFeralForm())
return GetMaxSkillValueForLevel(); // always maximized SKILL_FERAL_COMBAT in fact
// weapon skill or (unarmed for base attack)
@@ -10903,7 +10903,7 @@ uint32 Unit::GetCreatureType() const
{
if(GetTypeId() == TYPEID_PLAYER)
{
- SpellShapeshiftEntry const* ssEntry = sSpellShapeshiftStore.LookupEntry(((Player*)this)->m_form);
+ SpellShapeshiftEntry const* ssEntry = sSpellShapeshiftStore.LookupEntry(m_form);
if(ssEntry && ssEntry->creatureType > 0)
return ssEntry->creatureType;
else
diff --git a/src/game/Unit.h b/src/game/Unit.h
index c977a1f1b0e..a54945241d6 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -1302,8 +1302,11 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
uint64 m_ObjectSlot[4];
uint32 m_detectInvisibilityMask;
uint32 m_invisibilityMask;
+
uint32 m_ShapeShiftFormSpellId;
ShapeshiftForm m_form;
+ bool IsInFeralForm() const { return m_form == FORM_CAT || m_form == FORM_BEAR || m_form == FORM_DIREBEAR; }
+
float m_modMeleeHitChance;
float m_modRangedHitChance;
float m_modSpellHitChance;