fix(Core/Vehicle): parachute on vehicle exit (#25848)

This commit is contained in:
sogladev
2026-05-17 19:22:47 +02:00
committed by GitHub
parent 380f6cb60f
commit 2430168263

View File

@@ -506,6 +506,9 @@ void Vehicle::RemovePassenger(Unit* unit)
seat->second.Passenger.Reset();
// RemoveCharmedBy() clears MOVEMENTFLAG_FLYING, so cache this before uncharm.
bool wasFlying = _me->IsFlying();
if (_me->IsCreature() && unit->IsPlayer() && seat->second.SeatInfo->m_flags & VEHICLE_SEAT_FLAG_CAN_CONTROL)
_me->RemoveCharmedBy(unit);
@@ -521,7 +524,7 @@ void Vehicle::RemovePassenger(Unit* unit)
}
// only for flyable vehicles
if (_me->IsFlying() && !_me->GetInstanceId() && unit->IsPlayer() && !(unit->ToPlayer()->GetDelayedOperations() & DELAYED_VEHICLE_TELEPORT) && _me->GetEntry() != 30275 /*NPC_WILD_WYRM*/)
if (wasFlying && !_me->GetInstanceId() && unit->IsPlayer() && !(unit->ToPlayer()->GetDelayedOperations() & DELAYED_VEHICLE_TELEPORT) && _me->GetEntry() != 30275 /*NPC_WILD_WYRM*/)
_me->CastSpell(unit, VEHICLE_SPELL_PARACHUTE, true);
if (_me->IsCreature())