Core/Movement: Refactored removing transport part of movement info structure into a separate method. Also corrects seat set after exiting vehicle

This commit is contained in:
Shauren
2013-06-04 14:52:38 +02:00
parent fae3015044
commit cbd69f12bd
4 changed files with 13 additions and 12 deletions
+9
View File
@@ -442,6 +442,15 @@ struct MovementInfo
void SetFallTime(uint32 time) { fallTime = time; }
void ClearTransport()
{
t_guid = 0;
t_pos.Relocate(0.0f, 0.0f, 0.0f, 0.0f);
t_seat = -1;
t_time = 0;
t_time2 = 0;
}
void OutDebug();
};
+2 -6
View File
@@ -2116,9 +2116,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
{
m_transport->RemovePassenger(this);
m_transport = NULL;
m_movementInfo.t_pos.Relocate(0.0f, 0.0f, 0.0f, 0.0f);
m_movementInfo.t_time = 0;
m_movementInfo.t_seat = -1;
m_movementInfo.ClearTransport();
RepopAtGraveyard(); // teleport to near graveyard if on transport, looks blizz like :)
}
@@ -2144,9 +2142,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
{
m_transport->RemovePassenger(this);
m_transport = NULL;
m_movementInfo.t_pos.Relocate(0.0f, 0.0f, 0.0f, 0.0f);
m_movementInfo.t_time = 0;
m_movementInfo.t_seat = -1;
m_movementInfo.ClearTransport();
}
}
+1 -3
View File
@@ -519,9 +519,7 @@ void Vehicle::RemovePassenger(Unit* unit)
if (_me->IsInWorld())
{
unit->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
unit->m_movementInfo.t_pos.Relocate(0.0f, 0.0f, 0.0f, 0.0f);
unit->m_movementInfo.t_time = 0;
unit->m_movementInfo.t_seat = 0;
unit->m_movementInfo.ClearTransport();
}
// only for flyable vehicles
+1 -3
View File
@@ -348,9 +348,7 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvData)
{
plrMover->m_transport->RemovePassenger(plrMover);
plrMover->m_transport = NULL;
movementInfo.t_pos.Relocate(0.0f, 0.0f, 0.0f, 0.0f);
movementInfo.t_time = 0;
movementInfo.t_seat = -1;
movementInfo.ClearTransport();
}
// fall damage generation (ignore in flight case that can be triggered also at lags in moment teleportation to another map).