diff options
author | jackpoz <giacomopoz@gmail.com> | 2019-06-15 20:49:03 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-12-11 14:12:54 +0100 |
commit | 134fa225108381969b4a7dc22b4a3076a79c21f6 (patch) | |
tree | b01be6664ea1b9540fa3b631db6f43461f8cd2ca | |
parent | c08da9257540b611e58dc89837b9943ddf35c52f (diff) |
Core/Unit: Ignore On Transport spline movements if the Unit isn't on a transport anymore
On Transport splines use coordinates relative to the transport but if the transport is not found anymore than there is no way to get the absolute coordinates, leading to relative coordinates being used as absolute instead. The result is a Unit being set at position (0, 0, 0) or close by.
(cherry picked from commit c90f789eac9092d5332e92242ed0bfab7fd9e9fe)
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index c3e98c114c4..982341baedc 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -531,6 +531,8 @@ void Unit::UpdateSplinePosition() if (TransportBase* transport = GetDirectTransport()) transport->CalculatePassengerPosition(loc.x, loc.y, loc.z, &loc.orientation); + else + return; } if (HasUnitState(UNIT_STATE_CANNOT_TURN)) |