Core/Movement: Fix movement handler crash during ReadMovementInfo check (#26644)

* Core/Movement: Fix movement handler crash during ReadMovementInfo check

* fix noph build

* add an assert
This commit is contained in:
Chaouki Dhib
2021-07-04 18:49:30 +02:00
committed by GitHub
parent db2ad4b4ed
commit fdbff48808

View File

@@ -38,6 +38,7 @@
#include "Map.h"
#include "Metric.h"
#include "MoveSpline.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Opcodes.h"
#include "OutdoorPvPMgr.h"
@@ -926,7 +927,8 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi)
mi->RemoveMovementFlag((maskToRemove));
#endif
Unit* mover = GetGameClient()->GetActivelyMovedUnit();
Unit* 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))
REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_ROOT), MOVEMENTFLAG_ROOT);