mirror of
https://github.com/araxiaonline/TrinityCore2.git
synced 2026-06-18 13:59:39 -04:00
Core/Vehicles:
- Allow specifying of exit position for Unit::ExitVehicle - On Vehicle::InstallAccessory, despawn any accessory in the current seat with the same entry with TEMPSUMMON_MANUAL_DESPAWN type - Remove hacky TELEPORT_ACK packet on vehicle exit - Remove some redundant packet send operations that were already handled elsewhere
This commit is contained in:
@@ -16506,7 +16506,7 @@ void Unit::ChangeSeat(int8 seatId, bool next)
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
void Unit::ExitVehicle()
|
||||
void Unit::ExitVehicle(Position const* exitPosition)
|
||||
{
|
||||
if (!m_vehicle)
|
||||
return;
|
||||
@@ -16525,23 +16525,26 @@ void Unit::ExitVehicle()
|
||||
if (!m_vehicle)
|
||||
return;
|
||||
|
||||
//sLog->outError("exit vehicle");
|
||||
|
||||
m_vehicle->RemovePassenger(this);
|
||||
|
||||
// This should be done before dismiss, because there may be some aura removal
|
||||
Vehicle *vehicle = m_vehicle;
|
||||
m_vehicle = NULL;
|
||||
|
||||
SetControlled(false, UNIT_STAT_ROOT);
|
||||
SetControlled(false, UNIT_STAT_ROOT); // SMSG_MOVE_FORCE_UNROOT
|
||||
|
||||
if (exitPosition) // Exit position specified
|
||||
Relocate(exitPosition);
|
||||
else
|
||||
Relocate(vehicle->GetBase()); // Relocate to vehicle base
|
||||
|
||||
//Send leave vehicle, not correct
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
//this->ToPlayer()->SetClientControl(this, 1);
|
||||
this->ToPlayer()->SendTeleportAckPacket();
|
||||
this->ToPlayer()->SetFallInformation(0, GetPositionZ());
|
||||
}
|
||||
|
||||
WorldPacket data;
|
||||
BuildHeartBeatMsg(&data);
|
||||
SendMessageToSet(&data, false);
|
||||
|
||||
Reference in New Issue
Block a user