Core/Vehicles: disable passenger gravity also for vehicles that can fly by default

This commit is contained in:
Ovahlord
2020-02-09 19:22:13 +01:00
parent 9a220efa3a
commit 1192d02373

View File

@@ -563,7 +563,7 @@ Vehicle* Vehicle::RemovePassenger(Unit* unit)
_me->SetFlag(UNIT_NPC_FLAGS, (_me->GetTypeId() == TYPEID_PLAYER ? UNIT_NPC_FLAG_PLAYER_VEHICLE : UNIT_NPC_FLAG_SPELLCLICK));
// Enable gravity for passenger when he did not have it active before entering the vehicle
if (seat->second.SeatInfo->HasFlag(VEHICLE_SEAT_FLAG_DISABLE_GRAVITY))
if (seat->second.SeatInfo->HasFlag(VEHICLE_SEAT_FLAG_DISABLE_GRAVITY) || GetBase()->CanFly())
unit->SetDisableGravity(false);
// Remove UNIT_FLAG_NOT_SELECTABLE if passenger did not have it before entering vehicle
@@ -900,7 +900,7 @@ bool VehicleJoinEvent::Execute(uint64, uint32)
player->UnsummonPetTemporaryIfAny();
}
if (veSeat->HasFlag(VEHICLE_SEAT_FLAG_DISABLE_GRAVITY))
if (veSeat->HasFlag(VEHICLE_SEAT_FLAG_DISABLE_GRAVITY) || Target->GetBase()->CanFly())
Passenger->SetDisableGravity(true);
if (veSeat->HasFlag(VEHICLE_SEAT_FLAG_PASSENGER_NOT_SELECTABLE))