mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 16:38:42 +01:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user