diff options
| author | Gacko <gacko28@gmx.de> | 2013-01-12 13:47:32 +0100 |
|---|---|---|
| committer | Gacko <gacko28@gmx.de> | 2013-01-12 13:47:32 +0100 |
| commit | f739be50527407f9c189ecce16b6fc7598e235f9 (patch) | |
| tree | 497c1ccc6b88c75e0b5fb732977a7c13cdd4c62a /src | |
| parent | f46ac4a46c8f9605f2ab3d4a3c123a4f85d708ba (diff) | |
Core/UnitAI: Checks in DoCastVictim
Consider triggered flag and unit state
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/game/AI/CoreAI/UnitAI.cpp | 4 |
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); } |
