[9806] Fixed player loading to transport.

Bug exist already some time but possible hide by another code way work or
client change maybe.
This commit is contained in:
VladimirMangos 2010-04-29 17:23:51 +04:00
parent 6146e19acb
commit 9e356f10c9
4 changed files with 18 additions and 8 deletions

View file

@ -284,7 +284,7 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
{ {
plMover->m_transport->RemovePassenger(plMover); plMover->m_transport->RemovePassenger(plMover);
plMover->m_transport = NULL; 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). // fall damage generation (ignore in flight case that can be triggered also at lags in moment teleportation to another map).

View file

@ -1656,7 +1656,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
{ {
m_transport->RemovePassenger(this); m_transport->RemovePassenger(this);
m_transport = NULL; 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. // 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; 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)); _LoadBGData(holder->GetResult(PLAYER_LOGIN_QUERY_LOADBGDATA));
@ -15065,7 +15065,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
if (transGUID != 0) 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( if( !MaNGOS::IsValidMapCoord(
GetPositionX() + m_movementInfo.GetTransportPos()->x, GetPositionY() + m_movementInfo.GetTransportPos()->y, GetPositionX() + m_movementInfo.GetTransportPos()->x, GetPositionY() + m_movementInfo.GetTransportPos()->y,
@ -15079,7 +15079,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
RelocateToHomebind(); RelocateToHomebind();
m_movementInfo.SetTransportData(0, 0.0f, 0.0f, 0.0f, 0.0f, 0, -1); m_movementInfo.ClearTransportData();
transGUID = 0; transGUID = 0;
} }
@ -15113,7 +15113,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
RelocateToHomebind(); RelocateToHomebind();
m_movementInfo.SetTransportData(0, 0.0f, 0.0f, 0.0f, 0.0f, 0, -1); m_movementInfo.ClearTransportData();
transGUID = 0; transGUID = 0;
} }

View file

@ -763,7 +763,7 @@ class MovementInfo
// Position manipulations // Position manipulations
Position const *GetPos() const { return &pos; } 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_guid = guid;
t_pos.x = x; t_pos.x = x;
@ -773,6 +773,16 @@ class MovementInfo
t_time = time; t_time = time;
t_seat = seat; 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; } ObjectGuid const& GetTransportGuid() const { return t_guid; }
Position const *GetTransportPos() const { return &t_pos; } Position const *GetTransportPos() const { return &t_pos; }
int8 GetTransportSeat() const { return t_seat; } int8 GetTransportSeat() const { return t_seat; }

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "9805" #define REVISION_NR "9806"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__