Core/Vehicles: Make the vehicle system more aura driven. Get rid of redundant checks and update relevant data.

Closes #805
This commit is contained in:
Machiavelli
2011-03-04 21:17:06 +01:00
parent c2a2d7201b
commit a9582964d3
14 changed files with 80 additions and 79 deletions
@@ -99,7 +99,7 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recv_data)
{
if (Vehicle *vehicle = vehUnit->GetVehicleKit())
if (vehicle->HasEmptySeat(seatId))
GetPlayer()->EnterVehicle(vehicle, seatId);
GetPlayer()->_EnterVehicle(vehicle, seatId);
}
break;
}
@@ -116,7 +116,7 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recv_data)
else if (Unit *vehUnit = Unit::GetUnit(*GetPlayer(), guid))
if (Vehicle *vehicle = vehUnit->GetVehicleKit())
if (vehicle->HasEmptySeat(seatId))
GetPlayer()->EnterVehicle(vehicle, seatId);
GetPlayer()->_EnterVehicle(vehicle, seatId);
break;
}
default:
@@ -200,7 +200,6 @@ void WorldSession::HandleEjectPassenger(WorldPacket &data)
{
ASSERT(GetPlayer() == vehicle->GetBase());
unit->ExitVehicle();
unit->AddObjectToRemoveList();
}
else
sLog->outError("Player %u attempted to eject creature GUID %u from non-ejectable seat.", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid));