Core/Vehicles: Some research on VehicleSeatFlagsB.

It is assumed that VehicleSeatFlagsB & 322 means the seat can be used indirectly (ie. by aura 236 (SPELL_AURA_CONTROL_VEHICLE)) even though !(VehicleSeatFlags & VEHICLE_SEAT_FLAG_USABLE).
More research to be done Soon (tm).

--HG--
branch : trunk
This commit is contained in:
Machiavelli
2010-12-27 16:55:17 +01:00
parent ef347b53ef
commit dd745ef326
6 changed files with 37 additions and 27 deletions
+7 -7
View File
@@ -16676,7 +16676,7 @@ bool Unit::CheckPlayerCondition(Player* pPlayer)
}
}
void Unit::EnterVehicle(Vehicle *vehicle, int8 seatId)
void Unit::EnterVehicle(Vehicle *vehicle, int8 seatId, bool byAura)
{
if (!isAlive() || GetVehicleKit() == vehicle)
return;
@@ -16685,10 +16685,10 @@ void Unit::EnterVehicle(Vehicle *vehicle, int8 seatId)
{
if (m_vehicle == vehicle)
{
if (seatId >= 0)
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);
ChangeSeat(seatId, byAura);
}
return;
}
@@ -16717,7 +16717,7 @@ void Unit::EnterVehicle(Vehicle *vehicle, int8 seatId)
ASSERT(!m_vehicle);
m_vehicle = vehicle;
if (!m_vehicle->AddPassenger(this, seatId))
if (!m_vehicle->AddPassenger(this, seatId, byAura))
{
m_vehicle = NULL;
return;
@@ -16735,14 +16735,14 @@ void Unit::EnterVehicle(Vehicle *vehicle, int8 seatId)
}
}
void Unit::ChangeSeat(int8 seatId, bool next)
void Unit::ChangeSeat(int8 seatId, bool next, bool byAura)
{
if (!m_vehicle)
return;
if (seatId < 0)
{
seatId = m_vehicle->GetNextEmptySeat(GetTransSeat(), next);
seatId = m_vehicle->GetNextEmptySeat(GetTransSeat(), next, byAura);
if (seatId < 0)
return;
}
@@ -16750,7 +16750,7 @@ void Unit::ChangeSeat(int8 seatId, bool next)
return;
m_vehicle->RemovePassenger(this);
if (!m_vehicle->AddPassenger(this, seatId))
if (!m_vehicle->AddPassenger(this, seatId, byAura))
ASSERT(false);
}