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
+3 -6
View File
@@ -618,7 +618,7 @@ void Unit::UpdateSplinePosition()
pos.SetOrientation(loc.orientation);
if (TransportBase* transport = GetDirectTransport())
transport->CalculatePassengerPosition(loc.x, loc.y, loc.z, &loc.orientation);
transport->GetPositionWithOffset(pos).GetPosition(loc.x, loc.y, loc.z, loc.orientation);
else
return;
}
@@ -12852,10 +12852,7 @@ void Unit::SendTeleportPacket(TeleportLocation const& teleportLocation)
if (!transport)
return;
float x, y, z, o;
teleportLocation.Location.GetPosition(x, y, z, o);
transport->CalculatePassengerPosition(x, y, z, &o);
moveUpdateTeleport.Status->pos.Relocate(x, y, z, o);
moveUpdateTeleport.Status->pos.Relocate(transport->GetPositionWithOffset(teleportLocation.Location));
moveUpdateTeleport.Status->transport.pos.Relocate(teleportLocation.Location);
}
else
@@ -13078,7 +13075,7 @@ void CharmInfo::SaveStayPosition()
if (_unit->movespline->onTransport)
if (TransportBase* transport = _unit->GetDirectTransport())
transport->CalculatePassengerPosition(stayPos.x, stayPos.y, stayPos.z);
transport->GetPositionWithOffset({ stayPos.x, stayPos.y, stayPos.z }).GetPosition(stayPos.x, stayPos.y, stayPos.z);
_stayX = stayPos.x;
_stayY = stayPos.y;