File diff r14102:ba11c7b53daa → r14103:410cf09a59ff
src/order_cmd.cpp
Show inline comments
 
@@ -1412,26 +1412,12 @@ CommandCost CmdRestoreOrderIndex(TileInd
 
	}
 

	
 
	return CommandCost();
 
}
 

	
 

	
 
static TileIndex GetStationTileForVehicle(const Vehicle *v, const Station *st)
 
{
 
	if (!CanVehicleUseStation(v, st)) return INVALID_TILE;
 

	
 
	switch (v->type) {
 
		default: NOT_REACHED();
 
		case VEH_TRAIN:     return st->train_station.tile;
 
		case VEH_AIRCRAFT:  return st->airport_tile;
 
		case VEH_SHIP:      return st->dock_tile;
 
		case VEH_ROAD:      return st->GetPrimaryRoadStop(RoadVehicle::From(v))->xy;
 
	}
 
}
 

	
 

	
 
/**
 
 *
 
 * Check the orders of a vehicle, to see if there are invalid orders and stuff
 
 *
 
 */
 
void CheckOrders(const Vehicle *v)
 
@@ -1464,16 +1450,15 @@ void CheckOrders(const Vehicle *v)
 
				problem_type = 1;
 
				break;
 
			}
 
			/* Does station have a load-bay for this vehicle? */
 
			if (order->IsType(OT_GOTO_STATION)) {
 
				const Station *st = Station::Get(order->GetDestination());
 
				TileIndex required_tile = GetStationTileForVehicle(v, st);
 

	
 
				n_st++;
 
				if (required_tile == INVALID_TILE) problem_type = 3;
 
				if (!CanVehicleUseStation(v, st)) problem_type = 3;
 
			}
 
		}
 

	
 
		/* Check if the last and the first order are the same */
 
		if (v->GetNumOrders() > 1) {
 
			const Order *last = v->GetLastOrder();