mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 10:26:28 +01:00
Core/Creatures: Stop falling if corpse is removed (can happen when alive unit is despawned instantly in air) (#18995)
Do not allow to start waypoint movement when unit is dead
(cherry-picked from f86ca9e3c9)
This commit is contained in:
@@ -287,6 +287,10 @@ void Creature::RemoveCorpse(bool setSpawnTime)
|
||||
if (setSpawnTime)
|
||||
m_respawnTime = time(NULL) + respawnDelay;
|
||||
|
||||
// if corpse was removed during falling, the falling will continue and override relocation to respawn position
|
||||
if (IsFalling())
|
||||
StopMoving();
|
||||
|
||||
float x, y, z, o;
|
||||
GetRespawnPosition(x, y, z, &o);
|
||||
SetHomePosition(x, y, z, o);
|
||||
|
||||
@@ -120,6 +120,9 @@ bool WaypointMovementGenerator<Creature>::StartMove(Creature* creature)
|
||||
if (!i_path || i_path->nodes.empty())
|
||||
return false;
|
||||
|
||||
if (Stopped())
|
||||
return true;
|
||||
|
||||
bool transportPath = creature->GetTransport() != nullptr;
|
||||
|
||||
if (IsArrivalDone)
|
||||
|
||||
Reference in New Issue
Block a user