vehicle_gui.c
changeset 1294 4cdf0e76c093
parent 1279 bc761aad52b3
child 1299 39c06aba09aa
equal deleted inserted replaced
1293:be96e2bf9b3c 1294:4cdf0e76c093
   174 * 3. (uint32)_internal_name_sorter_id:	default StringID of the vehicle when no name is set. eg
   174 * 3. (uint32)_internal_name_sorter_id:	default StringID of the vehicle when no name is set. eg
   175 *    STR_SV_TRAIN_NAME for trains or STR_SV_AIRCRAFT_NAME for aircraft
   175 *    STR_SV_TRAIN_NAME for trains or STR_SV_AIRCRAFT_NAME for aircraft
   176 */
   176 */
   177 int CDECL VehicleUnsortedSorter(const void *a, const void *b)
   177 int CDECL VehicleUnsortedSorter(const void *a, const void *b)
   178 {
   178 {
   179 	return GetVehicle((*(const SortStruct*)a).index)->index - GetVehicle((*(const SortStruct*)b).index)->index;
   179 	return ((const SortStruct*)a)->index - ((const SortStruct*)b)->index;
   180 }
   180 }
   181 
   181 
   182 // if the sorting criteria had the same value, sort vehicle by unitnumber
   182 // if the sorting criteria had the same value, sort vehicle by unitnumber
   183 #define VEHICLEUNITNUMBERSORTER(r, a, b) {if (r == 0) {r = a->unitnumber - b->unitnumber;}}
   183 #define VEHICLEUNITNUMBERSORTER(r, a, b) {if (r == 0) {r = a->unitnumber - b->unitnumber;}}
   184 
   184