aboutsummaryrefslogtreecommitdiff
path: root/src/game/UnitAI.cpp
diff options
context:
space:
mode:
authormaximius <none@none>2009-09-20 19:07:53 -0700
committermaximius <none@none>2009-09-20 19:07:53 -0700
commit771341992f7a1d65bda418760b9f4fe032a80083 (patch)
tree07514ce6c6029ac01f8cc6f7743c76859d0ae603 /src/game/UnitAI.cpp
parent6c90f1f89a98ceb25da9a38474d968a4c8219f23 (diff)
*Ahn'Khalet: Partial Herald Volazj script, by Tartalo
*Check for null pointers in SelectTargetHelper, thanks to Spp *Remove rank aura from last battle (possibly there due to crash), by Spp --HG-- branch : trunk
Diffstat (limited to 'src/game/UnitAI.cpp')
-rw-r--r--src/game/UnitAI.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/game/UnitAI.cpp b/src/game/UnitAI.cpp
index d0a013393ba..728e6f36916 100644
--- a/src/game/UnitAI.cpp
+++ b/src/game/UnitAI.cpp
@@ -83,10 +83,10 @@ bool UnitAI::DoSpellAttackIfReady(uint32 spell)
inline bool SelectTargetHelper(const Unit * me, const Unit * target, const bool &playerOnly, const float &dist, const int32 &aura)
{
- if(playerOnly && target->GetTypeId() != TYPEID_PLAYER)
+ if(playerOnly && (!target || target->GetTypeId() != TYPEID_PLAYER))
return false;
- if(dist && !me->IsWithinCombatRange(target, dist))
+ if(dist && (!me || !target || !me->IsWithinCombatRange(target, dist)))
return false;
if(aura)