From 01318dbc8c6a8a300ecddc8ff97d7367b53da22d Mon Sep 17 00:00:00 2001 From: balrok Date: Sun, 11 Oct 2009 21:48:23 +0200 Subject: [PATCH] [8629] don't let eventaicreatures cast spells in stuns etc. also small correction to feign death (unit could still turn around to face his victim with this aura) --- src/game/CreatureEventAI.cpp | 3 ++- src/game/Unit.cpp | 2 +- src/shared/revision_nr.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/game/CreatureEventAI.cpp b/src/game/CreatureEventAI.cpp index ffb9b2803..74707b227 100644 --- a/src/game/CreatureEventAI.cpp +++ b/src/game/CreatureEventAI.cpp @@ -1341,7 +1341,8 @@ bool CreatureEventAI::CanCast(Unit* Target, SpellEntry const *Spell, bool Trigge return false; //Silenced so we can't cast - if (!Triggered && m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED)) + if (!Triggered && (m_creature->hasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING | UNIT_STAT_DIED) + || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED))) return false; //Check for power diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index e85f3a2bb..ea2837a4d 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -10234,7 +10234,7 @@ bool Unit::SelectHostilTarget() if(target) { - if(!hasUnitState(UNIT_STAT_STUNNED)) + if(!hasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_DIED)) SetInFront(target); ((Creature*)this)->AI()->AttackStart(target); return true; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 0384cf75d..c84570cdf 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8628" + #define REVISION_NR "8629" #endif // __REVISION_NR_H__