Core/Entities: Merge duplicate functions calculating relative positions - remove CalculatePassengerPosition/CalculatePassengerOffset from TransportBase class

This commit is contained in:
Shauren
2025-10-14 13:11:41 +02:00
parent d48e977315
commit a8f01e07d1
28 changed files with 141 additions and 300 deletions

View File

@@ -116,13 +116,8 @@ bool DynamicObject::CreateDynamicObject(ObjectGuid::LowType guidlow, Unit* caste
TransportBase* transport = caster->GetTransport();
if (transport)
{
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);
// This object must be added to transport before adding to map for the client to properly display it
transport->AddPassenger(this);
transport->AddPassenger(this, transport->GetPositionOffsetTo(pos));
}
if (!GetMap()->AddToMap(this))