aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-03-14 19:43:31 -0600
committermegamage <none@none>2009-03-14 19:43:31 -0600
commitd6e878caf27ccc07b63118636ac330f8eb9edac6 (patch)
treed86f8f7182abce2360e821437512e33e96e936ba /src
parentff60cf65a1f6a081bb8c24387ea56558484039a2 (diff)
parentbd79f8cb8b49a3886fdc9bab341bd2ceb29a8f47 (diff)
*Merge.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/PetAI.cpp5
-rw-r--r--src/game/PetAI.h1
2 files changed, 3 insertions, 3 deletions
diff --git a/src/game/PetAI.cpp b/src/game/PetAI.cpp
index b85d675e6a4..925f68f7eec 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++)
{
diff --git a/src/game/PetAI.h b/src/game/PetAI.h
index 056a9efa205..be38e03e13c 100644
--- a/src/game/PetAI.h
+++ b/src/game/PetAI.h
@@ -47,7 +47,6 @@ class TRINITY_DLL_DECL PetAI : public CreatureAI
void UpdateAllies();
Creature &i_pet;
- bool inCombat;
TimeTracker i_tracker;
std::set<uint64> m_AllySet;
uint32 m_updateAlliesTimer;