* Tests whether the company's vehicles have this station in orders * @param station station ID * @param include_company If true only check vehicles of \a company, if false only check vehicles of other companies * @param company company ID */
| 2857 | * @param company company ID |
| 2858 | */ |
| 2859 | bool HasStationInUse(StationID station, bool include_company, CompanyID company) |
| 2860 | { |
| 2861 | for (const OrderList *orderlist : OrderList::Iterate()) { |
| 2862 | const Vehicle *v = orderlist->GetFirstSharedVehicle(); |
| 2863 | assert(v != nullptr); |
| 2864 | if ((v->owner == company) != include_company) continue; |
| 2865 | |
| 2866 | for (const Order &order : orderlist->GetOrders()) { |
| 2867 | if (order.GetDestination() == station && (order.IsType(OT_GOTO_STATION) || order.IsType(OT_GOTO_WAYPOINT))) { |
| 2868 | return true; |
| 2869 | } |
| 2870 | } |
| 2871 | } |
| 2872 | return false; |
| 2873 | } |
| 2874 | |
| 2875 | static const TileIndexDiffC _dock_tileoffs_chkaround[] = { |
| 2876 | {-1, 0}, |
no test coverage detected