*More work on vehicle.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-04-21 13:36:34 -05:00
parent 4e1143c990
commit b154137401
3 changed files with 39 additions and 11 deletions

View File

@@ -500,11 +500,13 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recv_data)
if(seat == GetPlayer()->GetTransSeat())
return;
if(Vehicle *vehicle = GetPlayer()->m_Vehicle)
if(GetPlayer()->m_Vehicle)
{
if(vehicle->HasEmptySeat(seat))
if(Vehicle *vehicle = GetPlayer()->m_Vehicle->HasEmptySeat(seat))
{
vehicle->RemovePassenger(GetPlayer());
GetPlayer()->m_Vehicle->RemovePassenger(GetPlayer());
//If the player is going to a turret, the vehicle should be changed
GetPlayer()->m_Vehicle = vehicle;
if(!vehicle->AddPassenger(GetPlayer(), seat))
{
assert(false);