Merge branch 'mik1893/fear-vs-stun'

Merge PR #13095 into master
This commit is contained in:
jackpoz committed 2014-09-14 21:03:17 +02:00
commit 9337e257fc
1 file changed
+12 -4
+12 -4
View File
@@ -15504,11 +15504,18 @@ void Unit::SetControlled(bool apply, UnitState state)
{
case UNIT_STATE_STUNNED:
SetStunned(true);
// i need to stop fear on stun and root or i will get teleport to destination issue as MVMGEN for fear keeps going on
if (HasUnitState(UNIT_STATE_FLEEING))
SetFeared(false);
CastStop();
break;
case UNIT_STATE_ROOT:
if (!HasUnitState(UNIT_STATE_STUNNED))
{
SetRooted(true);
if (HasUnitState(UNIT_STATE_FLEEING))
SetFeared(false);
}
break;
case UNIT_STATE_CONFUSED:
if (!HasUnitState(UNIT_STATE_STUNNED))
@@ -15568,16 +15575,17 @@ void Unit::SetControlled(bool apply, UnitState state)
ClearUnitState(state);
if (HasUnitState(UNIT_STATE_STUNNED))
// Unit States might have been already cleared but auras still present. I need to check with HasAuraType
if (HasAuraType(SPELL_AURA_MOD_STUN))
SetStunned(true);
else
{
if (HasUnitState(UNIT_STATE_ROOT))
if (HasAuraType(SPELL_AURA_MOD_ROOT))
SetRooted(true);
if (HasUnitState(UNIT_STATE_CONFUSED))
if (HasAuraType(SPELL_AURA_MOD_CONFUSE))
SetConfused(true);
else if (HasUnitState(UNIT_STATE_FLEEING))
else if (HasAuraType(SPELL_AURA_MOD_FEAR))
SetFeared(true);
}
}