From 55d9e4c01d342e40db58481f89d58ec5c3940685 Mon Sep 17 00:00:00 2001 From: megamage Date: Fri, 12 Dec 2008 18:34:51 -0600 Subject: *Try to fix the bug that units may be feared forever. *Try to fix the bug that units still flee after death. --HG-- branch : trunk --- src/game/Unit.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index c8cf1239587..c7538a12774 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -10176,6 +10176,8 @@ void Unit::setDeathState(DeathState s) // remove aurastates allowing special moves ClearAllReactives(); ClearDiminishings(); + GetMotionMaster()->Clear(false); + GetMotionMaster()->MoveIdle(); StopMoving(); //without this when removing IncreaseMaxHealth aura player may stuck with 1 hp //do not why since in IncreaseMaxHealth currenthealth is checked @@ -12816,11 +12818,9 @@ void Unit::SetFeared(bool apply) else { RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING); - GetMotionMaster()->MovementExpired(false); - if( GetTypeId() != TYPEID_PLAYER && isAlive() ) + if(isAlive()) { - // restore appropriate movement generator - if(getVictim()) + if( GetTypeId() != TYPEID_PLAYER && getVictim()) GetMotionMaster()->MoveChase(getVictim()); else GetMotionMaster()->Initialize(); -- cgit v1.2.3