aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Battlegrounds
diff options
context:
space:
mode:
authorGolrag <golrag.jeremy@gmail.com>2024-05-25 21:02:41 +0200
committerOvahlord <dreadkiller@gmx.de>2024-06-20 00:53:56 +0200
commitc7374b620ba1c8d89203242614e9c0aba67b6461 (patch)
treef40798209bc2f88bbb748cecbeae42a12d720a23 /src/server/scripts/Battlegrounds
parent246956453655674739fca8ee2cfc0a84581d5250 (diff)
Core/Players: Allow targeting a specific transport during teleports
(cherry picked from commit 5b130cfb4253a94c08ff807e7f28e988651d2476)
Diffstat (limited to 'src/server/scripts/Battlegrounds')
-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