[10053] Use UNIT_STAT_CONTROLED for mark unit state under direct player control.

* This allow prevent move home/to caster at apply
* Also replace AI and reset movegens at control time
* Also stop combat and clear threat/hostile list at lost control for prevent combat with freindly units.
This commit is contained in:
VladimirMangos 2010-06-14 08:26:21 +04:00
parent e427ce80cc
commit b4b45333d8
9 changed files with 60 additions and 32 deletions

View file

@ -36,7 +36,7 @@ CanCastResult CreatureAI::CanCastSpell(Unit* pTarget, const SpellEntry *pSpell,
if (!isTriggered)
{
// State does not allow
if (m_creature->hasUnitState(UNIT_STAT_CAN_NOT_REACT))
if (m_creature->hasUnitState(UNIT_STAT_CAN_NOT_REACT_OR_LOST_CONTROL))
return CAST_FAIL_STATE;
if (pSpell->PreventionType == SPELL_PREVENTION_TYPE_SILENCE && m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED))