Merge pull request #14641 from tkrokli/Fix_cast_on_fear_while_rooted

Core/Spells: Fix being able to cast while feared and rooted at same time

Disallow to cast if feared and rooted at same time
This commit is contained in:
jackpoz committed 2015-05-06 20:21:21 +02:00
commit 1161295f4f
1 file changed
+3 -12
+3 -12
View File
@@ -15532,18 +15532,11 @@ 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))
@@ -15631,11 +15624,9 @@ void Unit::SetStunned(bool apply)
// setting MOVEMENTFLAG_ROOT
RemoveUnitMovementFlag(MOVEMENTFLAG_MASK_MOVING);
AddUnitMovementFlag(MOVEMENTFLAG_ROOT);
StopMoving();
// Creature specific
if (GetTypeId() != TYPEID_PLAYER)
StopMoving();
else
if (GetTypeId() == TYPEID_PLAYER)
SetStandState(UNIT_STAND_STATE_STAND);
WorldPacket data(SMSG_FORCE_MOVE_ROOT, 8);
@@ -15679,6 +15670,7 @@ void Unit::SetRooted(bool apply)
// setting MOVEMENTFLAG_ROOT
RemoveUnitMovementFlag(MOVEMENTFLAG_MASK_MOVING);
AddUnitMovementFlag(MOVEMENTFLAG_ROOT);
StopMoving();
if (GetTypeId() == TYPEID_PLAYER)
{
@@ -15692,7 +15684,6 @@ void Unit::SetRooted(bool apply)
WorldPacket data(SMSG_SPLINE_MOVE_ROOT, 8);
data << GetPackGUID();
SendMessageToSet(&data, true);
StopMoving();
}
}
else