diff --git a/src/game/Player.cpp b/src/game/Player.cpp index e259f733d..b465bddf1 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -5266,7 +5266,7 @@ void Player::UpdateWeaponSkill (WeaponAttackType attType) { // no skill gain in pvp Unit *pVictim = getVictim(); - if(pVictim && pVictim->GetTypeId() == TYPEID_PLAYER) + if(pVictim && pVictim->IsCharmerOrOwnerPlayerOrPlayerItself()) return; if(IsInFeralForm()) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 636253579..d7cd861ba 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -8480,6 +8480,14 @@ Unit *Unit::GetCharmer() const return NULL; } +bool Unit::IsCharmerOrOwnerPlayerOrPlayerItself() const +{ + if (GetTypeId()==TYPEID_PLAYER) + return true; + + return IS_PLAYER_GUID(GetCharmerOrOwnerGUID()); +} + Player* Unit::GetCharmerOrOwnerPlayerOrPlayerItself() { uint64 guid = GetCharmerOrOwnerGUID(); diff --git a/src/game/Unit.h b/src/game/Unit.h index a03a60a92..8164f6963 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1389,6 +1389,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject return this; } + bool IsCharmerOrOwnerPlayerOrPlayerItself() const; Player* GetCharmerOrOwnerPlayerOrPlayerItself(); float GetCombatDistance( const Unit* target ) const; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 17d420d69..14857c7fb 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "9286" + #define REVISION_NR "9287" #endif // __REVISION_NR_H__