aboutsummaryrefslogtreecommitdiff
path: root/src/game/PetAI.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-03-14 19:42:00 -0600
committermegamage <none@none>2009-03-14 19:42:00 -0600
commitbd79f8cb8b49a3886fdc9bab341bd2ceb29a8f47 (patch)
treeb445669ab4d765de9e2e548612d43079722820d2 /src/game/PetAI.cpp
parentc9874ee715480b41881704d40cc26f72562d5836 (diff)
*Fix broken pet autocast.
--HG-- branch : trunk
Diffstat (limited to 'src/game/PetAI.cpp')
-rw-r--r--src/game/PetAI.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/game/PetAI.cpp b/src/game/PetAI.cpp
index ad11a49c07d..2ed3edb2df6 100644
--- a/src/game/PetAI.cpp
+++ b/src/game/PetAI.cpp
@@ -38,7 +38,7 @@ int PetAI::Permissible(const Creature *creature)
return PERMIT_BASE_NO;
}
-PetAI::PetAI(Creature *c) : CreatureAI(c), i_pet(*c), i_tracker(TIME_INTERVAL_LOOK), inCombat(false)
+PetAI::PetAI(Creature *c) : CreatureAI(c), i_pet(*c), i_tracker(TIME_INTERVAL_LOOK)
{
m_AllySet.clear();
UpdateAllies();
@@ -59,7 +59,6 @@ bool PetAI::_needToStop() const
void PetAI::_stopAttack()
{
- inCombat = false;
if( !i_pet.isAlive() )
{
DEBUG_LOG("Creature stoped attacking cuz his dead [guid=%u]", i_pet.GetGUIDLow());
@@ -126,6 +125,8 @@ void PetAI::UpdateAI(const uint32 diff)
if (i_pet.GetGlobalCooldown() == 0 && !i_pet.hasUnitState(UNIT_STAT_CASTING))
{
+ bool inCombat = me->getVictim();
+
//Autocast
for (uint8 i = 0; i < i_pet.GetPetAutoSpellSize(); i++)
{