diff options
| author | Giacomo Pozzoni <giacomopoz@gmail.com> | 2021-06-06 17:51:00 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2022-03-10 23:57:14 +0100 |
| commit | 8111f50d035c1915165cb8ecd4938ba97820ed10 (patch) | |
| tree | 95f9879c1a3214209886e7d5006fedf53c01dbf4 /src/server/game/Entities/Unit | |
| parent | 89ea13ed46744414f74686cf2126dc637188180d (diff) | |
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 replace ff26027453179448bb972d88a51e565d71e95f3f
* 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 commit 9fe9dc087b4dc52af7897942a83c1f880d3a4ef8)
Diffstat (limited to 'src/server/game/Entities/Unit')
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index b11af5f555f..5ad1a1b6d19 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -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 |
