Core/Movement: Properly handle cases when jumping from one transport directly to another
This commit is contained in:
@@ -295,19 +295,45 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recvData)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if we boarded a transport, add us to it
|
// if we boarded a transport, add us to it
|
||||||
if (plrMover && !plrMover->GetTransport())
|
if (plrMover)
|
||||||
|
{
|
||||||
|
if (!plrMover->GetTransport())
|
||||||
{
|
{
|
||||||
// elevators also cause the client to send MOVEMENTFLAG_ONTRANSPORT - just dismount if the guid can be found in the transport list
|
// elevators also cause the client to send MOVEMENTFLAG_ONTRANSPORT - just dismount if the guid can be found in the transport list
|
||||||
for (MapManager::TransportSet::const_iterator iter = sMapMgr->m_Transports.begin(); iter != sMapMgr->m_Transports.end(); ++iter)
|
for (MapManager::TransportSet::const_iterator iter = sMapMgr->m_Transports.begin(); iter != sMapMgr->m_Transports.end(); ++iter)
|
||||||
{
|
{
|
||||||
if ((*iter)->GetGUID() == movementInfo.t_guid)
|
if ((*iter)->GetGUID() == movementInfo.t_guid)
|
||||||
{
|
{
|
||||||
plrMover->m_transport = (*iter);
|
plrMover->m_transport = *iter;
|
||||||
(*iter)->AddPassenger(plrMover);
|
(*iter)->AddPassenger(plrMover);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (plrMover->GetTransport()->GetGUID() != movementInfo.t_guid)
|
||||||
|
{
|
||||||
|
bool foundNewTransport = false;
|
||||||
|
plrMover->m_transport->RemovePassenger(plrMover);
|
||||||
|
for (MapManager::TransportSet::const_iterator iter = sMapMgr->m_Transports.begin(); iter != sMapMgr->m_Transports.end(); ++iter)
|
||||||
|
{
|
||||||
|
if ((*iter)->GetGUID() == movementInfo.t_guid)
|
||||||
|
{
|
||||||
|
foundNewTransport = true;
|
||||||
|
plrMover->m_transport = *iter;
|
||||||
|
(*iter)->AddPassenger(plrMover);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!foundNewTransport)
|
||||||
|
{
|
||||||
|
plrMover->m_transport = NULL;
|
||||||
|
movementInfo.t_pos.Relocate(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
movementInfo.t_time = 0;
|
||||||
|
movementInfo.t_seat = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!mover->GetTransport() && !mover->GetVehicle())
|
if (!mover->GetTransport() && !mover->GetVehicle())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user