Description: If a player use Nitro Boosts or any temp speed boost then ride a vehicle, if the speed aura fades once the player is inside the vehicle he will keep the speed boost.
Current behaviour: Player speed is not reset if a speed boost aura fades once he's inside a vehicle.
Expected behaviour: Player speed must be reset in all cases once the aura fades.
Steps to reproduce the problem:
Branch(es): both
TC rev. hash/commit: rev. 2286da2166dd
TDB version: CHANGEME Version of the TrinityCore database
Operating system: CHANGEME OS
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index bd4c71c06e..57467c0cc8 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -9400,7 +9400,7 @@ void Unit::SetSpeedRate(UnitMoveType mtype, float rate)
pet->SetSpeedRate(mtype, m_speed_rate[mtype]);
}
- if (Player* playerMover = GetPlayerBeingMoved()) // unit controlled by a player.
+ if (Player* playerMover = GetPlayerBeingMoved() ? GetPlayerBeingMoved() : ToPlayer()) // unit controlled by a player.
{
// Send notification to self. this packet is only sent to one client (the client of the player concerned by the change).
WorldPacket self;
Unit::GetPlayerBeingMoved() returns nullptr, because mover is the vehicle.
so... you need send packet to player (Unit = player in this moment), it solve this issue.
tested and works @Keader
What are you waiting for?
馃槃
"Is not correct form to deal with it" they say...
xD
馃樋
Most helpful comment
Unit::GetPlayerBeingMoved()returnsnullptr, becausemoveris the vehicle.so... you need send packet to player (Unit = player in this moment), it solve this issue.