aboutsummaryrefslogtreecommitdiff
path: root/src/game/CombatAI.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-08-25 23:55:37 -0500
committermegamage <none@none>2009-08-25 23:55:37 -0500
commit058e6827a69d1d3185109be4ddb8ac235478acf8 (patch)
treec7503f3e59e4077d4e85aeb366970699d661d179 /src/game/CombatAI.cpp
parent70aea97d53a79f1d17256c36d5e5e8943800f69a (diff)
*Always remove riding aura when exit vehicle.
*Other misc changes. --HG-- branch : trunk
Diffstat (limited to 'src/game/CombatAI.cpp')
-rw-r--r--src/game/CombatAI.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/game/CombatAI.cpp b/src/game/CombatAI.cpp
index 36d0b1699b8..37ef8186e2b 100644
--- a/src/game/CombatAI.cpp
+++ b/src/game/CombatAI.cpp
@@ -171,7 +171,7 @@ void CasterAI::UpdateAI(const uint32 diff)
ArchorAI::ArchorAI(Creature *c) : CreatureAI(c)
{
- assert(me->m_spells[0]);
+ ASSERT(me->m_spells[0]);
m_minRange = GetSpellMinRange(me->m_spells[0], false);
if(!m_minRange)
m_minRange = MELEE_RANGE;
@@ -181,6 +181,9 @@ ArchorAI::ArchorAI(Creature *c) : CreatureAI(c)
void ArchorAI::AttackStart(Unit *who)
{
+ if(!who)
+ return;
+
if(me->IsWithinCombatRange(who, m_minRange))
{
if(me->Attack(who, true) && !who->IsFlying())
@@ -214,16 +217,16 @@ void ArchorAI::UpdateAI(const uint32 diff)
TurretAI::TurretAI(Creature *c) : CreatureAI(c)
{
- assert(me->m_spells[0]);
+ ASSERT(me->m_spells[0]);
m_minRange = GetSpellMinRange(me->m_spells[0], false);
me->m_CombatDistance = GetSpellMaxRange(me->m_spells[0], false);
me->m_SightDistance = me->m_CombatDistance;
- sLog.outError("turret ai begins!");
}
void TurretAI::AttackStart(Unit *who)
{
- me->Attack(who, false);
+ if(who)
+ me->Attack(who, false);
}
void TurretAI::UpdateAI(const uint32 diff)