[9287] Prevent weapon skill grow at player's pet hit.

This commit is contained in:
VladimirMangos 2010-02-02 23:58:11 +03:00
parent af3aced775
commit 1f1f414d76
4 changed files with 11 additions and 2 deletions

View file

@ -5266,7 +5266,7 @@ void Player::UpdateWeaponSkill (WeaponAttackType attType)
{ {
// no skill gain in pvp // no skill gain in pvp
Unit *pVictim = getVictim(); Unit *pVictim = getVictim();
if(pVictim && pVictim->GetTypeId() == TYPEID_PLAYER) if(pVictim && pVictim->IsCharmerOrOwnerPlayerOrPlayerItself())
return; return;
if(IsInFeralForm()) if(IsInFeralForm())

View file

@ -8480,6 +8480,14 @@ Unit *Unit::GetCharmer() const
return NULL; return NULL;
} }
bool Unit::IsCharmerOrOwnerPlayerOrPlayerItself() const
{
if (GetTypeId()==TYPEID_PLAYER)
return true;
return IS_PLAYER_GUID(GetCharmerOrOwnerGUID());
}
Player* Unit::GetCharmerOrOwnerPlayerOrPlayerItself() Player* Unit::GetCharmerOrOwnerPlayerOrPlayerItself()
{ {
uint64 guid = GetCharmerOrOwnerGUID(); uint64 guid = GetCharmerOrOwnerGUID();

View file

@ -1389,6 +1389,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
return this; return this;
} }
bool IsCharmerOrOwnerPlayerOrPlayerItself() const;
Player* GetCharmerOrOwnerPlayerOrPlayerItself(); Player* GetCharmerOrOwnerPlayerOrPlayerItself();
float GetCombatDistance( const Unit* target ) const; float GetCombatDistance( const Unit* target ) const;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "9286" #define REVISION_NR "9287"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__