Core/Vehicles: Also remove MOVEMENTFLAG_ROOT on ExitVehicle (thanks to Anubisss), and slight refactoring of code.
This commit is contained in:
@@ -16535,13 +16535,6 @@ void Unit::ExitVehicle()
|
|||||||
|
|
||||||
SetControlled(false, UNIT_STAT_ROOT);
|
SetControlled(false, UNIT_STAT_ROOT);
|
||||||
|
|
||||||
RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_ROOT);
|
|
||||||
m_movementInfo.t_pos.Relocate(0, 0, 0, 0);
|
|
||||||
m_movementInfo.t_time = 0;
|
|
||||||
m_movementInfo.t_seat = 0;
|
|
||||||
|
|
||||||
Relocate(vehicle->GetBase());
|
|
||||||
|
|
||||||
//Send leave vehicle, not correct
|
//Send leave vehicle, not correct
|
||||||
if (GetTypeId() == TYPEID_PLAYER)
|
if (GetTypeId() == TYPEID_PLAYER)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -437,6 +437,13 @@ void Vehicle::RemovePassenger(Unit *unit)
|
|||||||
data << uint32(2); // Counter
|
data << uint32(2); // Counter
|
||||||
me->SendMessageToSet(&data, false);
|
me->SendMessageToSet(&data, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unit->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
|
||||||
|
unit->m_movementInfo.t_pos.Relocate(0, 0, 0, 0);
|
||||||
|
unit->m_movementInfo.t_time = 0;
|
||||||
|
unit->m_movementInfo.t_seat = 0;
|
||||||
|
|
||||||
|
unit->Relocate(GetBase());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (me->GetTypeId() == TYPEID_UNIT && me->ToCreature()->IsAIEnabled)
|
if (me->GetTypeId() == TYPEID_UNIT && me->ToCreature()->IsAIEnabled)
|
||||||
|
|||||||
Reference in New Issue
Block a user