Core/Vehicles: Fixed assertion failures related to seat changes, huge thanks to Machiavelli for well documented vehicle code and j4r0d for providing info how to reproduce the crash

This commit is contained in:
Shauren
2011-03-21 19:37:21 +01:00
parent 8f1a2f7cff
commit 827c9d3fe7

View File

@@ -100,7 +100,7 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recv_data)
{
if (Vehicle *vehicle = vehUnit->GetVehicleKit())
if (vehicle->HasEmptySeat(seatId))
GetPlayer()->_EnterVehicle(vehicle, seatId);
vehUnit->HandleSpellClick(GetPlayer(), seatId);
}
break;
}
@@ -117,7 +117,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);
vehUnit->HandleSpellClick(GetPlayer(), seatId);
break;
}
default: