mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
[9287] Prevent weapon skill grow at player's pet hit.
This commit is contained in:
parent
af3aced775
commit
1f1f414d76
4 changed files with 11 additions and 2 deletions
|
|
@ -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())
|
||||||
|
|
|
||||||
|
|
@ -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();
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue