Core/Movement: Add new flag MOVEMENTGENERATOR_FLAG_PERSIST_ON_DEATH

Port From (https://github.com/TrinityCore/TrinityCore/commit/8111f50d035c1915165cb8ecd4938ba97820ed10)
This commit is contained in:
hondacrx
2022-05-26 20:23:19 -04:00
parent ba87f08c37
commit 2703633af8
3 changed files with 28 additions and 12 deletions
+2 -12
View File
@@ -1397,18 +1397,8 @@ namespace Game.Entities
// Don't clear the movement if the Unit was on a vehicle as we are exiting now
if (!isOnVehicle)
{
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();
if (GetMotionMaster().StopOnDeath())
DisableSpline();
}
// without this when removing IncreaseMaxHealth aura player may stuck with 1 hp