mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 01:59:09 +00:00
fix(Core): prevent movement exploit (#2410)
This commit is contained in:
committed by
Francesco Borzì
parent
685538b01b
commit
ab637800e7
@@ -303,7 +303,7 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recvData)
|
||||
|
||||
Unit* mover = _player->m_mover;
|
||||
|
||||
ASSERT(mover != NULL); // there must always be a mover
|
||||
ASSERT(mover != nullptr); // there must always be a mover
|
||||
|
||||
Player* plrMover = mover->ToPlayer();
|
||||
|
||||
@@ -319,10 +319,16 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recvData)
|
||||
|
||||
recvData.readPackGUID(guid);
|
||||
|
||||
// prevent tampered movement data
|
||||
if (!guid || guid != mover->GetGUID()) {
|
||||
recvData.rfinish(); // prevent warnings spam
|
||||
return;
|
||||
}
|
||||
|
||||
// pussywizard: typical check for incomming movement packets
|
||||
if (!mover || !mover->IsInWorld() || mover->IsDuringRemoveFromWorld() || guid != mover->GetGUID())
|
||||
if (!mover || !(mover->IsInWorld()) || mover->IsDuringRemoveFromWorld() || !(mover->movespline->Finalized()))
|
||||
{
|
||||
recvData.rfinish();
|
||||
recvData.rfinish(); // prevent warnings spam
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -330,8 +336,7 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recvData)
|
||||
movementInfo.guid = guid;
|
||||
ReadMovementInfo(recvData, &movementInfo);
|
||||
|
||||
if (!movementInfo.pos.IsPositionValid())
|
||||
{
|
||||
if (!movementInfo.pos.IsPositionValid()) {
|
||||
recvData.rfinish(); // prevent warnings spam
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user