File diff r14925:076ddfff1625 → r14926:3d9a47be1c5a
src/build_vehicle_gui.cpp
Show inline comments
 
@@ -844,27 +844,28 @@ struct BuildVehicleWindow : Window {
 
		this->cargo_filter_texts[filter_items] = STR_PURCHASE_INFO_ALL_TYPES;
 
		filter_items++;
 

	
 
		/* Add item for vehicles not carrying anything, e.g. train engines.
 
		 * This could also be useful for eyecandy vehicles of other types, but is likely too confusing for joe, */
 
		if (this->vehicle_type == VEH_TRAIN) {
 
			this->cargo_filter[filter_items] = CF_NONE;
 
			this->cargo_filter_texts[filter_items] = STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE;
 
			filter_items++;
 
		}
 

	
 
		/* Collect available cargo types for filtering. */
 
		for (int i = 0; i < _sorted_cargo_specs_size; i++) {
 
			this->cargo_filter[filter_items] = _sorted_cargo_specs[i]->Index();
 
			this->cargo_filter_texts[filter_items] = _sorted_cargo_specs[i]->name;
 
		const CargoSpec *cs;
 
		FOR_ALL_SORTED_CARGOSPECS(cs) {
 
			this->cargo_filter[filter_items] = cs->Index();
 
			this->cargo_filter_texts[filter_items] = cs->name;
 
			filter_items++;
 
		}
 

	
 
		/* Terminate the filter list. */
 
		this->cargo_filter_texts[filter_items] = INVALID_STRING_ID;
 

	
 
		/* If not found, the cargo criteria will be set to all cargos. */
 
		this->cargo_filter_criteria = 0;
 

	
 
		/* Find the last cargo filter criteria. */
 
		for (uint i = 0; i < filter_items; i++) {
 
			if (this->cargo_filter[i] == _last_filter_criteria[this->vehicle_type]) {