mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 02:04:52 +01:00
Core: Only clear motionmaster flags if the respective entity exists in world.
Original patch by kewarr and Mrsmite, additional commenting by Machiavelli removing the pet-specific checks applied. Fixes #5400.
This commit is contained in:
@@ -12776,8 +12776,16 @@ void Unit::setDeathState(DeathState s)
|
||||
// remove aurastates allowing special moves
|
||||
ClearAllReactives();
|
||||
ClearDiminishings();
|
||||
GetMotionMaster()->Clear(false);
|
||||
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(false);
|
||||
GetMotionMaster()->MoveIdle();
|
||||
}
|
||||
StopMoving();
|
||||
DisableSpline();
|
||||
// without this when removing IncreaseMaxHealth aura player may stuck with 1 hp
|
||||
|
||||
Reference in New Issue
Block a user