fix(Core/Pets): Properly cast spells on friendly target if not in LoS… (#9570)

* fix(Core/Pets): Properly cast spells on friendly target if not in LoS or out of range.

Fixes #7790
This commit is contained in:
UltraNix
2021-12-12 13:25:10 +01:00
committed by GitHub
parent 5e65ce72cc
commit 4e93671b3c
6 changed files with 26 additions and 9 deletions

View File

@@ -890,7 +890,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, ObjectGuid guid1, uint32 spe
charmInfo->SetIsCommandFollow(false);
charmInfo->SetIsReturning(false);
pet->GetMotionMaster()->MoveChase(unit_target);
pet->GetMotionMaster()->MoveFollow(unit_target, PET_FOLLOW_DIST, rand_norm() * 2 * M_PI);
if (pet->IsPet() && ((Pet*)pet)->getPetType() == SUMMON_PET && pet != unit_target && urand(0, 100) < 10)
pet->SendPetTalk((uint32)PET_TALK_SPECIAL_SPELL);