aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
authorGolrag <golrag.jeremy@gmail.com>2024-05-25 21:02:41 +0200
committerShauren <shauren.trinity@gmail.com>2024-05-25 22:05:53 +0200
commit5b130cfb4253a94c08ff807e7f28e988651d2476 (patch)
tree18023dcbeb5f52ab8f10758b06e65b5489b624c6 /src/server/scripts
parentebf8917b788ca5cc5555c3cfe1ae224ec0ef1b7d (diff)
Core/Players: Allow targeting a specific transport during teleports
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Battlegrounds/IsleOfConquest/isle_of_conquest.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/server/scripts/Battlegrounds/IsleOfConquest/isle_of_conquest.cpp b/src/server/scripts/Battlegrounds/IsleOfConquest/isle_of_conquest.cpp
index 2c9fdce6596..357e7bba238 100644
--- a/src/server/scripts/Battlegrounds/IsleOfConquest/isle_of_conquest.cpp
+++ b/src/server/scripts/Battlegrounds/IsleOfConquest/isle_of_conquest.cpp
@@ -210,15 +210,11 @@ class spell_ioc_gunship_portal : public SpellScript
void HandleScript(SpellEffIndex /*effIndex*/)
{
Player* caster = GetCaster()->ToPlayer();
- /*
- * HACK: GetWorldLocation() returns real position and not transportposition.
- * ServertoClient: SMSG_MOVE_TELEPORT (0x0B39)
- * counter: 45
- * Tranpsort Guid: Full: xxxx Type: MOTransport Low: xxx
- * Transport Position X: 0 Y: 0 Z: 0 O: 0
- * Position: X: 7.305609 Y: -0.095246 Z: 34.51022 O: 0
- */
- caster->TeleportTo(GetHitCreature()->GetWorldLocation(), TELE_TO_NOT_LEAVE_TRANSPORT);
+ Optional<ObjectGuid> transportGuid;
+ if (TransportBase const* transport = GetHitCreature()->GetTransport())
+ transportGuid = transport->GetTransportGUID();
+
+ caster->TeleportTo({ .Location = WorldLocation(GetHitCreature()->GetMapId(), GetHitCreature()->GetTransOffset()), .TransportGuid = transportGuid });
}
void Register() override