diff options
author | jackpoz <giacomopoz@gmail.com> | 2015-05-06 20:21:21 +0200 |
---|---|---|
committer | DDuarte <dnpd.dd@gmail.com> | 2015-06-26 02:56:20 +0100 |
commit | 6df2d03f7282ef9b1635304e300787806d69d70c (patch) | |
tree | cbb0599569e5443ba4add3793dfe09eed2ca46a4 | |
parent | 133d6cd85ffb64f433c6e52de8357d73ff8459c8 (diff) |
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
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
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); |