diff --git a/Source/Game/Entities/Unit/Unit.cs b/Source/Game/Entities/Unit/Unit.cs index 5048af40d..71bd602a6 100644 --- a/Source/Game/Entities/Unit/Unit.cs +++ b/Source/Game/Entities/Unit/Unit.cs @@ -1363,6 +1363,8 @@ namespace Game.Entities // Death state needs to be updated before RemoveAllAurasOnDeath() is called, to prevent entering combat m_deathState = s; + bool isOnVehicle = GetVehicle() != null; + if (s != DeathState.Alive && s != DeathState.JustRespawned) { CombatStop(); @@ -1383,18 +1385,24 @@ namespace Game.Entities // remove aurastates allowing special moves ClearAllReactives(); m_Diminishing.Clear(); - if (IsInWorld) + + // Don't clear the movement if the Unit was on a vehicle as we are exiting now + if (!isOnVehicle) { - // Only clear MotionMaster for entities that exists in world - // Avoids crashes in the following conditions : - // * Using 'call pet' on dead pets - // * Using 'call stabled pet' - // * Logging in with dead pets - GetMotionMaster().Clear(); - GetMotionMaster().MoveIdle(); + if (IsInWorld) + { + // Only clear MotionMaster for entities that exists in world + // Avoids crashes in the following conditions : + // * Using 'call pet' on dead pets + // * Using 'call stabled pet' + // * Logging in with dead pets + GetMotionMaster().Clear(); + GetMotionMaster().MoveIdle(); + } + StopMoving(); + DisableSpline(); } - StopMoving(); - DisableSpline(); + // without this when removing IncreaseMaxHealth aura player may stuck with 1 hp // do not why since in IncreaseMaxHealth currenthealth is checked SetHealth(0);