From 6df2d03f7282ef9b1635304e300787806d69d70c Mon Sep 17 00:00:00 2001 From: jackpoz Date: Wed, 6 May 2015 20:21:21 +0200 Subject: 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 (cherry picked from commit 1161295f4f933661ea9738e0c57049a1e38ec8f2) Conflicts: src/server/game/Entities/Unit/Unit.cpp --- src/server/game/Entities/Unit/Unit.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index e94ab61265c..a2e08158a68 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -13680,18 +13680,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)) @@ -13775,10 +13768,9 @@ void Unit::SetStunned(bool apply) SetTarget(ObjectGuid::Empty); SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); - // Creature specific - if (GetTypeId() != TYPEID_PLAYER) - StopMoving(); - else + StopMoving(); + + if (GetTypeId() == TYPEID_PLAYER) SetStandState(UNIT_STAND_STATE_STAND); SetRooted(true); @@ -13811,6 +13803,7 @@ void Unit::SetRooted(bool apply, bool packetOnly /*= false*/) // setting MOVEMENTFLAG_ROOT RemoveUnitMovementFlag(MOVEMENTFLAG_MASK_MOVING); AddUnitMovementFlag(MOVEMENTFLAG_ROOT); + StopMoving(); } else RemoveUnitMovementFlag(MOVEMENTFLAG_ROOT); -- cgit v1.2.3