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:
xinef1
2017-01-30 10:57:24 +01:00
committed by Shauren
parent 2e45423537
commit befea2f7a6
2 changed files with 7 additions and 0 deletions

View File

@@ -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);

View File

@@ -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)