mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-25 14:46:24 +00:00
fix(Core/PetHandler): Allow PetAI to handle flags (#19446)
When a pet ability was cast, PetHandler reset all CharmInfo flags before calling PetAI methods, setting the attack flag to true every time. This commands the pet to go and chase the target which is not correct when the state is COMMAND_STAY. PetAI already handles the scenario, it just wasn't getting the actual pet attack state.
This commit is contained in:
@@ -754,17 +754,12 @@ void Pet::Update(uint32 diff)
|
||||
GetMotionMaster()->Clear(false);
|
||||
GetMotionMaster()->MoveIdle();
|
||||
|
||||
bool oldCmdAttack = GetCharmInfo()->IsCommandAttack();
|
||||
|
||||
GetCharmInfo()->SetIsCommandAttack(false);
|
||||
GetCharmInfo()->SetIsAtStay(true);
|
||||
GetCharmInfo()->SetIsCommandFollow(false);
|
||||
GetCharmInfo()->SetIsFollowing(false);
|
||||
GetCharmInfo()->SetIsReturning(false);
|
||||
GetCharmInfo()->SaveStayPosition(true);
|
||||
|
||||
GetCharmInfo()->SetIsCommandAttack(oldCmdAttack);
|
||||
|
||||
AddSpellCooldown(tempspell, 0, spellInfo->IsCooldownStartedOnEvent() ? infinityCooldownDelay : 0);
|
||||
|
||||
CastSpell(tempspellTarget, tempspell, false);
|
||||
|
||||
Reference in New Issue
Block a user