Scripts/ICC: Fix teleporter not removing players from Gunship

A more generic solution might be better, maybe depending on spell flags

Ref #25652

(cherry picked from commit 0ad1854d1c)
This commit is contained in:
jackpoz
2020-12-28 12:38:34 +01:00
committed by Shauren
parent 30ebecc0de
commit abbac041bf

View File

@@ -26,6 +26,7 @@
#include "Spell.h"
#include "SpellInfo.h"
#include "SpellMgr.h"
#include "Transport.h"
static std::vector<uint32> const TeleportSpells =
{
@@ -69,6 +70,11 @@ class icecrown_citadel_teleport : public GameObjectScript
return true;
}
// If the player is on the ship, Unit::NearTeleport() will try to keep the player on the ship, causing issues.
// For that we simply always remove the player from the ship.
if (Transport* transport = player->GetTransport())
transport->RemovePassenger(player);
player->CastSpell(player, spell->Id, true);
return true;
}