From a8f01e07d111ea14cbe843d82fbfce19f63faa12 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 14 Oct 2025 13:11:41 +0200 Subject: Core/Entities: Merge duplicate functions calculating relative positions - remove CalculatePassengerPosition/CalculatePassengerOffset from TransportBase class --- .../battleground_strand_of_the_ancients.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/server/scripts/Battlegrounds') diff --git a/src/server/scripts/Battlegrounds/StrandOfTheAncients/battleground_strand_of_the_ancients.cpp b/src/server/scripts/Battlegrounds/StrandOfTheAncients/battleground_strand_of_the_ancients.cpp index feb9c4334d1..9cefe03b553 100644 --- a/src/server/scripts/Battlegrounds/StrandOfTheAncients/battleground_strand_of_the_ancients.cpp +++ b/src/server/scripts/Battlegrounds/StrandOfTheAncients/battleground_strand_of_the_ancients.cpp @@ -554,16 +554,12 @@ struct battleground_strand_of_the_ancients : BattlegroundScript { if (TransportBase* transport = boat->ToTransportBase()) { - player->Relocate(spawnPositionOnTransport[_attackers]); - transport->AddPassenger(player); - player->m_movementInfo.transport.pos.Relocate(spawnPositionOnTransport[_attackers]); - float x, y, z, o; - spawnPositionOnTransport[_attackers].GetPosition(x, y, z, o); - transport->CalculatePassengerPosition(x, y, z, &o); - player->Relocate(x, y, z, o); + transport->AddPassenger(player, spawnPositionOnTransport[_attackers]); + Position position = transport->GetPositionWithOffset(player->m_movementInfo.transport.pos); + player->Relocate(position); if (player->IsInWorld()) - player->NearTeleportTo({ x, y, z, o }); + player->NearTeleportTo(position); } } } -- cgit v1.2.3