Core/Unit: Fall after exiting vehicle if is in air and can not fly

This commit is contained in:
Gacko
2013-03-15 19:32:46 +01:00
parent 44553d3fd4
commit 59bc6ed0ae

View File

@@ -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();