comparison src/vehicle.cpp @ 5748:d463e4aecd52 draft

(svn r8296) -Fix: GenerateVehicleSortList() tried to put a TileIndex into an uint16 -Fix: CmdMassStartStopVehicle() tried to put a TileIndex into an uint16 Those two bugs were unrelated to each other and unrelated to r8295, even though that commit touched the code in question
author bjarni <bjarni@openttd.org>
date Sun, 21 Jan 2007 01:25:59 +0000
parents 61edd889181d
children b7c916fdba99
comparison
equal deleted inserted replaced
5747:61edd889181d 5748:d463e4aecd52
1619 case VEH_Aircraft: stop_command = CMD_START_STOP_AIRCRAFT; break; 1619 case VEH_Aircraft: stop_command = CMD_START_STOP_AIRCRAFT; break;
1620 default: return CMD_ERROR; 1620 default: return CMD_ERROR;
1621 } 1621 }
1622 1622
1623 if (vehicle_list_window) { 1623 if (vehicle_list_window) {
1624 uint16 id = GB(p1, 0, 16); 1624 uint32 id = p1;
1625 uint16 window_type = p2 & VLW_MASK; 1625 uint16 window_type = p2 & VLW_MASK;
1626 1626
1627 engine_count = GenerateVehicleSortList((const Vehicle***)&vl, &engine_list_length, vehicle_type, _current_player, id, window_type); 1627 engine_count = GenerateVehicleSortList((const Vehicle***)&vl, &engine_list_length, vehicle_type, _current_player, id, window_type);
1628 } else { 1628 } else {
1629 /* Get the list of vehicles in the depot */ 1629 /* Get the list of vehicles in the depot */
2367 VLW_STANDARD: not used 2367 VLW_STANDARD: not used
2368 VLW_DEPOT_LIST: TileIndex of the depot/hangar to make the list for 2368 VLW_DEPOT_LIST: TileIndex of the depot/hangar to make the list for
2369 * @param window_type tells what kind of window the list is for. Use the VLW flags in vehicle_gui.h 2369 * @param window_type tells what kind of window the list is for. Use the VLW flags in vehicle_gui.h
2370 * @return the number of vehicles added to the list 2370 * @return the number of vehicles added to the list
2371 */ 2371 */
2372 uint GenerateVehicleSortList(const Vehicle ***sort_list, uint16 *length_of_array, byte type, PlayerID owner, uint16 index, uint16 window_type) 2372 uint GenerateVehicleSortList(const Vehicle ***sort_list, uint16 *length_of_array, byte type, PlayerID owner, uint32 index, uint16 window_type)
2373 { 2373 {
2374 const uint subtype = (type != VEH_Aircraft) ? Train_Front : 2; 2374 const uint subtype = (type != VEH_Aircraft) ? Train_Front : 2;
2375 uint n = 0; 2375 uint n = 0;
2376 const Vehicle *v; 2376 const Vehicle *v;
2377 2377