mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 02:46:33 +01:00
*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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user