diff --git a/src/game/MovementHandler.cpp b/src/game/MovementHandler.cpp index b892be88e..189ff3320 100644 --- a/src/game/MovementHandler.cpp +++ b/src/game/MovementHandler.cpp @@ -284,7 +284,7 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data ) { plMover->m_transport->RemovePassenger(plMover); plMover->m_transport = NULL; - movementInfo.SetTransportData(0, 0.0f, 0.0f, 0.0f, 0.0f, 0, -1); + movementInfo.ClearTransportData(); } // fall damage generation (ignore in flight case that can be triggered also at lags in moment teleportation to another map). diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 7869f37ce..49168816b 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -1656,7 +1656,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati { m_transport->RemovePassenger(this); m_transport = NULL; - m_movementInfo.SetTransportData(0, 0.0f, 0.0f, 0.0f, 0.0f, 0, -1); + m_movementInfo.ClearTransportData(); } // The player was ported to another map and looses the duel immediately. @@ -15011,7 +15011,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder ) transGUID = 0; - m_movementInfo.SetTransportData(0, 0.0f, 0.0f, 0.0f, 0.0f, 0, -1); + m_movementInfo.ClearTransportData(); } _LoadBGData(holder->GetResult(PLAYER_LOGIN_QUERY_LOADBGDATA)); @@ -15065,7 +15065,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder ) if (transGUID != 0) { - m_movementInfo.SetTransportData(transGUID, fields[26].GetFloat(), fields[27].GetFloat(), fields[28].GetFloat(), fields[29].GetFloat(), 0, -1); + m_movementInfo.SetTransportData(ObjectGuid(HIGHGUID_MO_TRANSPORT,transGUID), fields[26].GetFloat(), fields[27].GetFloat(), fields[28].GetFloat(), fields[29].GetFloat(), 0, -1); if( !MaNGOS::IsValidMapCoord( GetPositionX() + m_movementInfo.GetTransportPos()->x, GetPositionY() + m_movementInfo.GetTransportPos()->y, @@ -15079,7 +15079,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder ) RelocateToHomebind(); - m_movementInfo.SetTransportData(0, 0.0f, 0.0f, 0.0f, 0.0f, 0, -1); + m_movementInfo.ClearTransportData(); transGUID = 0; } @@ -15113,7 +15113,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder ) RelocateToHomebind(); - m_movementInfo.SetTransportData(0, 0.0f, 0.0f, 0.0f, 0.0f, 0, -1); + m_movementInfo.ClearTransportData(); transGUID = 0; } diff --git a/src/game/Unit.h b/src/game/Unit.h index 1a6fd5ef5..808d9c392 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -763,7 +763,7 @@ class MovementInfo // Position manipulations Position const *GetPos() const { return &pos; } - void SetTransportData(uint64 guid, float x, float y, float z, float o, uint32 time, int8 seat) + void SetTransportData(ObjectGuid guid, float x, float y, float z, float o, uint32 time, int8 seat) { t_guid = guid; t_pos.x = x; @@ -773,6 +773,16 @@ class MovementInfo t_time = time; t_seat = seat; } + void ClearTransportData() + { + t_guid = ObjectGuid(); + t_pos.x = 0.0f; + t_pos.y = 0.0f; + t_pos.z = 0.0f; + t_pos.o = 0.0f; + t_time = 0; + t_seat = -1; + } ObjectGuid const& GetTransportGuid() const { return t_guid; } Position const *GetTransportPos() const { return &t_pos; } int8 GetTransportSeat() const { return t_seat; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index d1f351a4f..b275b3b8a 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 "9805" + #define REVISION_NR "9806" #endif // __REVISION_NR_H__