Core/Transports: Fixed crash happening during teleporting transports
Closes #11793
This commit is contained in:
@@ -48,18 +48,6 @@ DynamicObject::~DynamicObject()
|
||||
delete _removedAura;
|
||||
}
|
||||
|
||||
void DynamicObject::CleanupsBeforeDelete(bool finalCleanup /* = true */)
|
||||
{
|
||||
WorldObject::CleanupsBeforeDelete(finalCleanup);
|
||||
|
||||
if (Transport* transport = GetTransport())
|
||||
{
|
||||
transport->RemovePassenger(this);
|
||||
SetTransport(NULL);
|
||||
m_movementInfo.transport.Reset();
|
||||
}
|
||||
}
|
||||
|
||||
void DynamicObject::AddToWorld()
|
||||
{
|
||||
///- Register the dynamicObject for guid lookup and for caster
|
||||
@@ -124,14 +112,11 @@ bool DynamicObject::CreateDynamicObject(uint32 guidlow, Unit* caster, uint32 spe
|
||||
Transport* transport = caster->GetTransport();
|
||||
if (transport)
|
||||
{
|
||||
m_movementInfo.transport.guid = GetGUID();
|
||||
|
||||
float x, y, z, o;
|
||||
pos.GetPosition(x, y, z, o);
|
||||
transport->CalculatePassengerOffset(x, y, z, &o);
|
||||
m_movementInfo.transport.pos.Relocate(x, y, z, o);
|
||||
|
||||
SetTransport(transport);
|
||||
// This object must be added to transport before adding to map for the client to properly display it
|
||||
transport->AddPassenger(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user