*Fix a bug that player can change to an occupied seat on vehicle.

(The commit message of the last rev should be: do not allow player to use unusable vehicle seat)

--HG--
branch : trunk
This commit is contained in:
megamage
2009-05-23 20:41:48 -05:00
parent 27e3352d2b
commit 2475390852
2 changed files with 18 additions and 11 deletions

View File

@@ -517,9 +517,12 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recv_data)
recv_data >> seatId;
if(!guid)
GetPlayer()->ChangeSeat(-1, seatId > 0);
GetPlayer()->ChangeSeat(-1, seatId > 0); // prev/next
else if(Vehicle *vehicle = ObjectAccessor::GetVehicle(guid))
GetPlayer()->EnterVehicle(vehicle, seatId);
{
if(vehicle->HasEmptySeat(seatId))
GetPlayer()->EnterVehicle(vehicle, seatId);
}
}
void WorldSession::HandleRequestVehicleExit(WorldPacket &recv_data)