Trinitycore: Core/Movements: Speed exploit

Created on 11 Dec 2017  路  4Comments  路  Source: TrinityCore/TrinityCore

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:

  1. .go c id 33109 (requires gm on to enter the raid)
  2. .cast 54861 (on your char)
  3. ride the vehicle before the aura fades
  4. Once the aura fades dismount and notice your char's speed.

Branch(es): both

TC rev. hash/commit: rev. 2286da2166dd

TDB version: CHANGEME Version of the TrinityCore database

Operating system: CHANGEME OS

Comp-Core Feedback-FixOutdatedMissingWIP Sub-Entities Sub-Exploit

Most helpful comment

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.

All 4 comments

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

馃樋

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Jildor picture Jildor  路  3Comments

cbcs picture cbcs  路  3Comments

daddycaddy picture daddycaddy  路  3Comments

ZenoX92 picture ZenoX92  路  3Comments

funjoker picture funjoker  路  3Comments