aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Server/WorldSession.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp
index e3c9ad3569c..5a6d42fd38f 100644
--- a/src/server/game/Server/WorldSession.cpp
+++ b/src/server/game/Server/WorldSession.cpp
@@ -927,7 +927,16 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi)
mi->RemoveMovementFlag((maskToRemove));
#endif
- Unit* mover = GetPlayer()->GetGUID() == mi->guid ? GetPlayer() : ObjectAccessor::GetUnit(*GetPlayer(), mi->guid);
+ Unit* mover = GetGameClient()->GetActivelyMovedUnit();
+ if (!mover)
+ {
+ if (mi->guid.IsEmpty())
+ {
+ TC_LOG_ERROR("entities.unit", "WorldSession::ReadMovementInfo: GetActivelyMovedUnit() returned no mover and mi->guid is empty, opcode %u", static_cast<uint32>(data.GetOpcode()));
+ return;
+ }
+ mover = GetPlayer()->GetGUID() == mi->guid ? GetPlayer() : ObjectAccessor::GetUnit(*GetPlayer(), mi->guid);
+ }
ASSERT(mover, "if the server allows this unit to be moved by the client, the unit should still exist!");
if (!GetPlayer()->GetVehicleBase() || !(GetPlayer()->GetVehicle()->GetVehicleInfo()->Flags & VEHICLE_FLAG_FIXED_POSITION))