Skip to content

Commit ea6bb10

Browse files
committed
Revert "Core/Entities: improve unit on death movement"
This reverts commit f4d8105.
1 parent 154f960 commit ea6bb10

File tree

3 files changed

+10
-20
lines changed

3 files changed

+10
-20
lines changed

src/server/game/Entities/Creature/Creature.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2006,6 +2006,13 @@ void Creature::setDeathState(DeathState s)
20062006
if (m_formation && m_formation->GetLeader() == this)
20072007
m_formation->FormationReset(true);
20082008

2009+
bool needsFalling = (IsFlying() || IsHovering()) && !IsUnderWater();
2010+
SetHover(false, false);
2011+
SetDisableGravity(false, false);
2012+
2013+
if (needsFalling)
2014+
GetMotionMaster()->MoveFall();
2015+
20092016
Unit::setDeathState(CORPSE);
20102017
}
20112018
else if (s == JUST_RESPAWNED)

src/server/game/Entities/Unit/Unit.cpp

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8760,28 +8760,9 @@ void Unit::setDeathState(DeathState s)
87608760
if (!isOnVehicle)
87618761
{
87628762
if (GetMotionMaster()->StopOnDeath())
8763-
{
8764-
if (!HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED) && GetTypeId() == TYPEID_UNIT && ToCreature()->IsInAir(*this, GetFloorZ(), false) && !IsUnderWater())
8765-
{
8766-
GetMotionMaster()->AddFlag(MOTIONMASTER_FLAG_STATIC_PREVENT_INITIALIZATION);
8767-
SetFall(true);
8768-
Movement::MoveSplineInit init(this);
8769-
init.MoveTo(GetPositionX(), GetPositionY(), GetFloorZ(), false, true);
8770-
init.SetFall();
8771-
init.Launch();
8772-
}
8773-
else
8774-
{
8775-
StopMoving();
8776-
DisableSpline();
8777-
}
8778-
}
8763+
DisableSpline();
87798764
}
87808765

8781-
SetDisableGravity(false);
8782-
SetCanFly(false);
8783-
SetHover(false);
8784-
87858766
// without this when removing IncreaseMaxHealth aura player may stuck with 1 hp
87868767
// do not why since in IncreaseMaxHealth currenthealth is checked
87878768
SetHealth(0);

src/server/game/Movement/MotionMaster.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,8 @@ bool MotionMaster::StopOnDeath()
563563
MoveIdle();
564564
}
565565

566+
_owner->StopMoving();
567+
566568
return true;
567569
}
568570

0 commit comments

Comments
 (0)