diff options
author | Gacko <gacko28@gmx.de> | 2013-03-15 19:32:46 +0100 |
---|---|---|
committer | Gacko <gacko28@gmx.de> | 2013-03-15 19:36:50 +0100 |
commit | 59bc6ed0ae09a63be9562425afb9533d07b702ea (patch) | |
tree | 6f80295b0556acde86c3c16221b845a6519390f3 /src | |
parent | 44553d3fd4d9d808f4a863fa26297ef97a03bac1 (diff) |
Core/Unit: Fall after exiting vehicle if is in air and can not fly
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 97b85b555e8..d76885591a5 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -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(); |