Core/Vehicles: Chart VEHICLE_SEAT_FLAG_UNCONTROLLED and implement usage. Concerns vehicleseat enter/exit capabilities. Fixes vehicles related to Malygos encounter.

Original research by rsa, thanks to Manuel for pointing out.
This commit is contained in:
Machiavelli
2011-02-19 21:58:50 +01:00
parent 7e2ddb2fd3
commit c0b29fd0ad
5 changed files with 17 additions and 21 deletions
+5 -10
View File
@@ -16417,7 +16417,7 @@ void Unit::EnterVehicle(Vehicle *vehicle, int8 seatId, AuraApplication const * a
if (seatId >= 0 && seatId != GetTransSeat())
{
sLog->outDebug("EnterVehicle: %u leave vehicle %u seat %d and enter %d.", GetEntry(), m_vehicle->GetBase()->GetEntry(), GetTransSeat(), seatId);
ChangeSeat(seatId, aurApp != NULL);
ChangeSeat(seatId);
}
return;
}
@@ -16451,7 +16451,7 @@ void Unit::EnterVehicle(Vehicle *vehicle, int8 seatId, AuraApplication const * a
ASSERT(!m_vehicle);
m_vehicle = vehicle;
if (!m_vehicle->AddPassenger(this, seatId, aurApp != NULL))
if (!m_vehicle->AddPassenger(this, seatId))
{
m_vehicle = NULL;
return;
@@ -16471,14 +16471,14 @@ void Unit::EnterVehicle(Vehicle *vehicle, int8 seatId, AuraApplication const * a
}
void Unit::ChangeSeat(int8 seatId, bool next, bool byAura)
void Unit::ChangeSeat(int8 seatId, bool next)
{
if (!m_vehicle)
return;
if (seatId < 0)
{
seatId = m_vehicle->GetNextEmptySeat(GetTransSeat(), next, byAura);
seatId = m_vehicle->GetNextEmptySeat(GetTransSeat(), next);
if (seatId < 0)
return;
}
@@ -16486,7 +16486,7 @@ void Unit::ChangeSeat(int8 seatId, bool next, bool byAura)
return;
m_vehicle->RemovePassenger(this);
if (!m_vehicle->AddPassenger(this, seatId, byAura))
if (!m_vehicle->AddPassenger(this, seatId))
ASSERT(false);
}
@@ -16565,11 +16565,6 @@ void Unit::BuildMovementPacket(ByteBuffer *data) const
break;
}
if (Vehicle* pVehicle = GetVehicle())
if (!HasUnitMovementFlag(MOVEMENTFLAG_ROOT))
sLog->outError("Unit (GUID: " UI64FMTD ", entry: %u) does not have MOVEMENTFLAG_ROOT but is in vehicle (ID: %u)!",
GetGUID(), GetEntry(), pVehicle->GetVehicleInfo()->m_ID);
*data << uint32(GetUnitMovementFlags()); // movement flags
*data << uint16(m_movementInfo.flags2); // 2.3.0
*data << uint32(getMSTime()); // time