mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 15:40:45 +01:00
Core/Unit: Fall after exiting vehicle if is in air and can not fly
This commit is contained in:
@@ -16940,14 +16940,19 @@ void Unit::_ExitVehicle(Position const* exitPosition)
|
||||
SendMessageToSet(&data, false);
|
||||
}
|
||||
|
||||
float height = pos.GetPositionZ();
|
||||
|
||||
Movement::MoveSplineInit init(this);
|
||||
init.MoveTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), false);
|
||||
|
||||
// Creatures without inhabit type air should begin falling after exiting the vehicle
|
||||
if (GetTypeId() == TYPEID_UNIT && !CanFly() && height > GetMap()->GetWaterOrGroundLevel(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), &height) + 0.1f)
|
||||
init.SetFall();
|
||||
|
||||
init.MoveTo(pos.GetPositionX(), pos.GetPositionY(), height, false);
|
||||
init.SetFacing(GetOrientation());
|
||||
init.SetTransportExit();
|
||||
init.Launch();
|
||||
|
||||
//GetMotionMaster()->MoveFall(); // Enable this once passenger positions are calculater properly (see above)
|
||||
|
||||
if (player)
|
||||
player->ResummonPetTemporaryUnSummonedIfAny();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user