Skip to content

Commit

Permalink
Remove unused Unit parameter from CorrectData.
Browse files Browse the repository at this point in the history
  • Loading branch information
ratkosrb committed Jun 21, 2024
1 parent ce5aac7 commit aca9f5d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/game/Anticheat/MovementAnticheat/MovementAnticheat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ uint32 MovementAnticheat::HandlePositionTests(Player* pPlayer, MovementInfo& mov
if (IsFlagAckOpcode(opcode))
{
me->m_movementInfo.moveFlags = movementInfo.moveFlags;
me->m_movementInfo.CorrectData(me);
me->m_movementInfo.CorrectData();
}

if (HAS_CHEAT(CHEAT_TYPE_OVERSPEED_JUMP) &&
Expand Down
8 changes: 4 additions & 4 deletions src/game/Handlers/MovementHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ void WorldSession::HandleForceSpeedChangeAckOpcodes(WorldPacket& recvData)
{
// Can only change flags and speed for not current active mover.
pMover->m_movementInfo.moveFlags = movementInfo.moveFlags;
pMover->m_movementInfo.CorrectData(pMover);
pMover->m_movementInfo.CorrectData();
}
}

Expand Down Expand Up @@ -629,7 +629,7 @@ void WorldSession::HandleMovementFlagChangeToggleAck(WorldPacket& recvData)
{
// Can only change flags and speed for not current active mover.
pMover->m_movementInfo.moveFlags = movementInfo.moveFlags;
pMover->m_movementInfo.CorrectData(pMover);
pMover->m_movementInfo.CorrectData();
}
} while (false);

Expand Down Expand Up @@ -730,7 +730,7 @@ void WorldSession::HandleMoveRootAck(WorldPacket& recvData)
{
// Can only change flags and speed for not current active mover.
pMover->m_movementInfo.moveFlags = movementInfo.moveFlags;
pMover->m_movementInfo.CorrectData(pMover);
pMover->m_movementInfo.CorrectData();
}
} while (false);

Expand Down Expand Up @@ -1098,7 +1098,7 @@ void WorldSession::HandleMoverRelocation(Unit* pMover, MovementInfo& movementInf
Player* const pPlayerMover = pMover->ToPlayer();

movementInfo.sourceSessionGuid = GetGUID();
movementInfo.CorrectData(pMover);
movementInfo.CorrectData();

// Prevent client from removing root flag.
if (pMover->HasUnitMovementFlag(MOVEFLAG_ROOT) && !movementInfo.HasMovementFlag(MOVEFLAG_ROOT))
Expand Down
7 changes: 2 additions & 5 deletions src/game/Objects/MovementInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
#include "ObjectGuid.h"
#include "Timer.h"

class Unit;

// [-ZERO] Need check and update
// used in most movement packets (send and received)
// used in most movement packets (sent and received)
enum MovementFlags
{
MOVEFLAG_NONE = 0x00000000, // 0
Expand Down Expand Up @@ -168,7 +166,7 @@ class MovementInfo
// Read/Write methods
void Read(ByteBuffer &data);
void Write(ByteBuffer &data) const;
void CorrectData(Unit* mover = nullptr);
void CorrectData();

// Movement flags manipulations
void AddMovementFlag(int f) { moveFlags |= f; }
Expand Down Expand Up @@ -261,5 +259,4 @@ inline ByteBuffer& operator>> (ByteBuffer& buf, MovementInfo& mi)
return buf;
}


#endif
2 changes: 1 addition & 1 deletion src/game/Objects/Object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void MovementInfo::Read(ByteBuffer &data)
}
}

void MovementInfo::CorrectData(Unit* mover)
void MovementInfo::CorrectData()
{
// Nostalrius: remove incompatible flags, causing client freezes for example
#define REMOVE_VIOLATING_FLAGS(check, maskToRemove) \
Expand Down

0 comments on commit aca9f5d

Please sign in to comment.