aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Entities')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp15
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