mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +00:00
[10958] Rename function to CanUseEquippedWeapon
Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
4fe41fb335
commit
b3076146fc
6 changed files with 9 additions and 9 deletions
|
|
@ -7289,7 +7289,7 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool appl
|
|||
ApplyFeralAPBonus(feral_bonus, apply);
|
||||
}
|
||||
|
||||
if (!IsUseEquipedWeapon(attType))
|
||||
if (!CanUseEquippedWeapon(attType))
|
||||
return;
|
||||
|
||||
if (proto->Delay)
|
||||
|
|
@ -9095,7 +9095,7 @@ Item* Player::GetWeaponForAttack(WeaponAttackType attackType, bool nonbroken, bo
|
|||
if (!item || item->GetProto()->Class != ITEM_CLASS_WEAPON)
|
||||
return NULL;
|
||||
|
||||
if (useable && !IsUseEquipedWeapon(attackType))
|
||||
if (useable && !CanUseEquippedWeapon(attackType))
|
||||
return NULL;
|
||||
|
||||
if (nonbroken && item->IsBroken())
|
||||
|
|
@ -9113,7 +9113,7 @@ Item* Player::GetShield(bool useable) const
|
|||
if (!useable)
|
||||
return item;
|
||||
|
||||
if (item->IsBroken() || !IsUseEquipedWeapon(OFF_ATTACK))
|
||||
if (item->IsBroken() || !CanUseEquippedWeapon(OFF_ATTACK))
|
||||
return NULL;
|
||||
|
||||
return item;
|
||||
|
|
|
|||
|
|
@ -440,7 +440,7 @@ void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, fl
|
|||
weapon_mindamage = lvl*0.85f*att_speed;
|
||||
weapon_maxdamage = lvl*1.25f*att_speed;
|
||||
}
|
||||
else if (!IsUseEquipedWeapon(attType)) // check if player not in form but still can't use weapon (broken/etc)
|
||||
else if (!CanUseEquippedWeapon(attType)) // check if player not in form but still can't use weapon (broken/etc)
|
||||
{
|
||||
weapon_mindamage = BASE_MINDAMAGE;
|
||||
weapon_maxdamage = BASE_MAXDAMAGE;
|
||||
|
|
|
|||
|
|
@ -353,7 +353,7 @@ void Unit::Update( uint32 update_diff, uint32 p_time )
|
|||
|
||||
bool Unit::haveOffhandWeapon() const
|
||||
{
|
||||
if (!IsUseEquipedWeapon(OFF_ATTACK))
|
||||
if (!CanUseEquippedWeapon(OFF_ATTACK))
|
||||
return false;
|
||||
|
||||
if(GetTypeId() == TYPEID_PLAYER)
|
||||
|
|
@ -3330,7 +3330,7 @@ float Unit::GetUnitBlockChance() const
|
|||
if(GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
Player const* player = (Player const*)this;
|
||||
if(player->CanBlock() && player->IsUseEquipedWeapon(OFF_ATTACK))
|
||||
if(player->CanBlock() && player->CanUseEquippedWeapon(OFF_ATTACK))
|
||||
{
|
||||
Item *tmpitem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
|
||||
if(tmpitem && !tmpitem->IsBroken() && tmpitem->GetProto()->Block)
|
||||
|
|
|
|||
|
|
@ -1199,7 +1199,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
|
|||
uint32 getAttackTimer(WeaponAttackType type) const { return m_attackTimer[type]; }
|
||||
bool isAttackReady(WeaponAttackType type = BASE_ATTACK) const { return m_attackTimer[type] == 0; }
|
||||
bool haveOffhandWeapon() const;
|
||||
bool IsUseEquipedWeapon(WeaponAttackType attackType) const
|
||||
bool CanUseEquippedWeapon(WeaponAttackType attackType) const
|
||||
{
|
||||
if (IsInFeralForm())
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -407,7 +407,7 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, SpellAuraHolder* holder, S
|
|||
{
|
||||
// Check if player is wearing shield
|
||||
Item *item = ((Player*)this)->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
|
||||
if(!item || item->IsBroken() || !IsUseEquipedWeapon(OFF_ATTACK) || item->GetProto()->Class != ITEM_CLASS_ARMOR || !((1<<item->GetProto()->SubClass) & spellProto->EquippedItemSubClassMask))
|
||||
if(!item || item->IsBroken() || !CanUseEquippedWeapon(OFF_ATTACK) || item->GetProto()->Class != ITEM_CLASS_ARMOR || !((1<<item->GetProto()->SubClass) & spellProto->EquippedItemSubClassMask))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "10957"
|
||||
#define REVISION_NR "10958"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue