From 88d0744f1b76bb982287831aceed082335602847 Mon Sep 17 00:00:00 2001 From: click Date: Tue, 14 Sep 2010 18:36:56 +0200 Subject: [PATCH] Core/PetAI: Make pets respect being in passive mode (fixes a few "stuck in front of target"-issues with pets on certain occations) - setting pet into passive mode before reaching its target (after an attack-command) will break attack (return "home" to follow/stay position) - setting pet into passive mode and fully attacking target will make it return home properly --HG-- branch : trunk --- src/server/game/AI/CoreAI/PetAI.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index bd5b45bdf3..f975f3f96b 100644 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -96,7 +96,7 @@ void PetAI::UpdateAI(const uint32 diff) { if (_needToStop()) { - sLog.outStaticDebug("Pet AI stoped attacking [guid=%u]", me->GetGUIDLow()); + sLog.outStaticDebug("Pet AI stopped attacking [guid=%u]", me->GetGUIDLow()); _stopAttack(); return; } @@ -109,6 +109,8 @@ void PetAI::UpdateAI(const uint32 diff) if (nextTarget) AttackStart(nextTarget); + if (me->HasReactState(REACT_PASSIVE)) + _stopAttack(); else HandleReturnMovement(); }