aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/CoreAI/UnitAI.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/server/game/AI/CoreAI/UnitAI.cpp b/src/server/game/AI/CoreAI/UnitAI.cpp
index a3cb57b3332..09ba2cc19b1 100644
--- a/src/server/game/AI/CoreAI/UnitAI.cpp
+++ b/src/server/game/AI/CoreAI/UnitAI.cpp
@@ -172,7 +172,9 @@ void UnitAI::DoCast(Unit* victim, uint32 spellId, bool triggered)
void UnitAI::DoCastVictim(uint32 spellId, bool triggered)
{
- // Why don't we check for casting unit_state and existing target as we do in DoCast(.. ?
+ if (!me->getVictim() || (me->HasUnitState(UNIT_STATE_CASTING) && !triggered))
+ return;
+
me->CastSpell(me->getVictim(), spellId, triggered);
}