aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Battlegrounds
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2025-10-14 13:11:41 +0200
committerShauren <shauren.trinity@gmail.com>2025-10-14 13:11:41 +0200
commita8f01e07d111ea14cbe843d82fbfce19f63faa12 (patch)
tree2aca52b9b4dfa9723ec170e672e2a4ddb7481178 /src/server/scripts/Battlegrounds
parentd48e97731538b01c4005cd7c73653a0f33015098 (diff)
Core/Entities: Merge duplicate functions calculating relative positions - remove CalculatePassengerPosition/CalculatePassengerOffset from TransportBase class
Diffstat (limited to 'src/server/scripts/Battlegrounds')
-rw-r--r--src/server/scripts/Battlegrounds/StrandOfTheAncients/battleground_strand_of_the_ancients.cpp12
1 files changed, 4 insertions, 8 deletions
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);
}
}
}