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:
Machiavelli
2011-02-25 01:38:21 +01:00
parent a6e30e0509
commit 04b656a44f
4 changed files with 26 additions and 28 deletions
+8 -5
View File
@@ -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);