*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
This commit is contained in:
+4
-4
@@ -10176,6 +10176,8 @@ void Unit::setDeathState(DeathState s)
|
|||||||
// remove aurastates allowing special moves
|
// remove aurastates allowing special moves
|
||||||
ClearAllReactives();
|
ClearAllReactives();
|
||||||
ClearDiminishings();
|
ClearDiminishings();
|
||||||
|
GetMotionMaster()->Clear(false);
|
||||||
|
GetMotionMaster()->MoveIdle();
|
||||||
StopMoving();
|
StopMoving();
|
||||||
//without this when removing IncreaseMaxHealth aura player may stuck with 1 hp
|
//without this when removing IncreaseMaxHealth aura player may stuck with 1 hp
|
||||||
//do not why since in IncreaseMaxHealth currenthealth is checked
|
//do not why since in IncreaseMaxHealth currenthealth is checked
|
||||||
@@ -12816,11 +12818,9 @@ void Unit::SetFeared(bool apply)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
|
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
|
||||||
GetMotionMaster()->MovementExpired(false);
|
if(isAlive())
|
||||||
if( GetTypeId() != TYPEID_PLAYER && isAlive() )
|
|
||||||
{
|
{
|
||||||
// restore appropriate movement generator
|
if( GetTypeId() != TYPEID_PLAYER && getVictim())
|
||||||
if(getVictim())
|
|
||||||
GetMotionMaster()->MoveChase(getVictim());
|
GetMotionMaster()->MoveChase(getVictim());
|
||||||
else
|
else
|
||||||
GetMotionMaster()->Initialize();
|
GetMotionMaster()->Initialize();
|
||||||
|
|||||||
Reference in New Issue
Block a user