diff --git a/src/game/MovementHandler.cpp b/src/game/MovementHandler.cpp index 2fead25de..f347cb6b1 100644 --- a/src/game/MovementHandler.cpp +++ b/src/game/MovementHandler.cpp @@ -241,7 +241,7 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data ) recv_data >> movementInfo; /*----------------*/ - if (!VerifyMovementInfo(movementInfo,guid,mover)) + if (!VerifyMovementInfo(movementInfo, guid)) return; // fall damage generation (ignore in flight case that can be triggered also at lags in moment teleportation to another map). @@ -249,7 +249,7 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data ) plMover->HandleFall(movementInfo); /* process position-change */ - HandleMoverRelocation(movementInfo,mover,plMover); + HandleMoverRelocation(movementInfo); if (plMover) plMover->UpdateFallInformationIfNeed(movementInfo, opcode); @@ -432,10 +432,10 @@ void WorldSession::HandleMoveKnockBackAck( WorldPacket & recv_data ) recv_data >> Unused(); // knockback packets counter recv_data >> movementInfo; - if (!VerifyMovementInfo(movementInfo,guid,mover)) + if (!VerifyMovementInfo(movementInfo, guid)) return; - HandleMoverRelocation(movementInfo, mover, plMover); + HandleMoverRelocation(movementInfo); WorldPacket data(MSG_MOVE_KNOCK_BACK, recv_data.size() + 15); data << mover->GetPackGUID(); @@ -486,10 +486,10 @@ void WorldSession::HandleSummonResponseOpcode(WorldPacket& recv_data) _player->SummonIfPossible(agree); } -bool WorldSession::VerifyMovementInfo(MovementInfo& movementInfo, ObjectGuid& guid, Unit* mover) const +bool WorldSession::VerifyMovementInfo(MovementInfo const& movementInfo, ObjectGuid const& guid) const { // ignore wrong guid (player attempt cheating own session for not own guid possible...) - if (guid != mover->GetObjectGuid()) + if (guid != _player->GetMover()->GetObjectGuid()) return false; if (!MaNGOS::IsValidMapCoord(movementInfo.GetPos()->x, movementInfo.GetPos()->y, movementInfo.GetPos()->z, movementInfo.GetPos()->o)) @@ -512,11 +512,13 @@ bool WorldSession::VerifyMovementInfo(MovementInfo& movementInfo, ObjectGuid& gu return true; } -void WorldSession::HandleMoverRelocation(MovementInfo& movementInfo, Unit* mover, Player* plMover) +void WorldSession::HandleMoverRelocation(MovementInfo& movementInfo) { movementInfo.UpdateTime(getMSTime()); - if (plMover) + Unit *mover = _player->GetMover(); + + if (Player *plMover = mover->GetTypeId() == TYPEID_PLAYER ? (Player*)mover : NULL) { if (movementInfo.HasMovementFlag(MOVEFLAG_ONTRANSPORT)) { diff --git a/src/game/WorldSession.h b/src/game/WorldSession.h index e6d68259e..0c362c4c9 100644 --- a/src/game/WorldSession.h +++ b/src/game/WorldSession.h @@ -778,8 +778,8 @@ class MANGOS_DLL_SPEC WorldSession private: // private trade methods void moveItems(Item* myItems[], Item* hisItems[]); - bool VerifyMovementInfo(MovementInfo&,ObjectGuid&, Unit*) const; - void HandleMoverRelocation(MovementInfo&, Unit*, Player*); + bool VerifyMovementInfo(MovementInfo const& movementInfo, ObjectGuid const& guid) const; + void HandleMoverRelocation(MovementInfo& movementInfo); void ExecuteOpcode( OpcodeHandler const& opHandle, WorldPacket* packet ); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 84f8d07eb..57c6181e6 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "10731" + #define REVISION_NR "10732" #endif // __REVISION_NR_H__