Core/Transports: Fixed crashes happening when passenger is removed from transport during teleport

Closes #11067
This commit is contained in:
Shauren committed 2013-10-20 14:27:17 +02:00
1 parent f8b1b264d1
commit b6db622b52
4 files changed
+25 -38

No files matched your search

+6 -3
View File
@@ -13499,9 +13499,12 @@ void Unit::CleanupsBeforeDelete(bool finalCleanup)
{
CleanupBeforeRemoveFromMap(finalCleanup);
if (Creature* thisCreature = ToCreature())
if (GetTransport())
GetTransport()->RemovePassenger(thisCreature);
if (GetTransport())
{
GetTransport()->RemovePassenger(this);
SetTransport(NULL);
m_movementInfo.transport.Reset();
}
}
void Unit::UpdateCharmAI()