Core/Pets: Fixed flashing pet attack button (#18906)
Port TrinityCore Commit: https://github.com/TrinityCore/TrinityCore/commit/d1cbd8a837116a0fadae06cf5714a345035eb799
This commit is contained in:
@@ -121,6 +121,7 @@ namespace Game
|
||||
return;
|
||||
|
||||
pet.AttackStop();
|
||||
pet.ClearInPetCombat();
|
||||
}
|
||||
|
||||
void HandlePetActionHelper(Unit pet, ObjectGuid guid1, uint spellid, ActiveStates flag, ObjectGuid guid2, float x, float y, float z)
|
||||
@@ -154,6 +155,7 @@ namespace Game
|
||||
case CommandStates.Follow: //spellid=1792 //FOLLOW
|
||||
pet.AttackStop();
|
||||
pet.InterruptNonMeleeSpells(false);
|
||||
pet.ClearInPetCombat();
|
||||
pet.GetMotionMaster().MoveFollow(GetPlayer(), SharedConst.PetFollowDist, pet.GetFollowAngle());
|
||||
charmInfo.SetCommandState(CommandStates.Follow);
|
||||
|
||||
@@ -210,9 +212,6 @@ namespace Game
|
||||
}
|
||||
else // charmed player
|
||||
{
|
||||
if (pet.GetVictim() && pet.GetVictim() != TargetUnit)
|
||||
pet.AttackStop();
|
||||
|
||||
charmInfo.SetIsCommandAttack(true);
|
||||
charmInfo.SetIsAtStay(false);
|
||||
charmInfo.SetIsFollowing(false);
|
||||
@@ -267,6 +266,7 @@ namespace Game
|
||||
{
|
||||
case ReactStates.Passive: //passive
|
||||
pet.AttackStop();
|
||||
pet.ClearInPetCombat();
|
||||
goto case ReactStates.Defensive;
|
||||
case ReactStates.Defensive: //recovery
|
||||
case ReactStates.Aggressive: //activete
|
||||
@@ -363,8 +363,6 @@ namespace Game
|
||||
// This is true if pet has no target or has target but targets differs.
|
||||
if (pet.GetVictim() != unit_target)
|
||||
{
|
||||
if (pet.GetVictim())
|
||||
pet.AttackStop();
|
||||
pet.GetMotionMaster().Clear();
|
||||
if (pet.ToCreature().IsAIEnabled)
|
||||
pet.ToCreature().GetAI().AttackStart(unit_target);
|
||||
|
||||
Reference in New Issue
Block a user