mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-19 14:39:43 -04:00
Core/Movement: Add new flag MOVEMENTGENERATOR_FLAG_PERSIST_ON_DEATH (#26549)
* Core/Movement: Add new flag MOVEMENTGENERATOR_FLAG_PERSIST_ON_DEATH Add new flag MOVEMENTGENERATOR_FLAG_PERSIST_ON_DEATH to keep movement generators even after death. Fixes #23095 Could replaceff26027453* Core/Movement: reorder new method MotionMaster::StopOnDeath * Core/Movement: reorder new method MotionMaster::StopOnDeath * Keep MoveJump movement generator after death Co-authored-by: ccrs <ccrs@users.noreply.github.com> (cherry picked from commit9fe9dc087b)
This commit is contained in:
@@ -8259,19 +8259,8 @@ void Unit::setDeathState(DeathState s)
|
||||
// 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
|
||||
|
||||
Reference in New Issue
Block a user