* Check whether the given vehicle should stop at the given station * based on this order and the non-stop settings. * @param v the vehicle that might be stopping. * @param station the station to stop at. * @return true if the vehicle should stop. */
| 2174 | * @return true if the vehicle should stop. |
| 2175 | */ |
| 2176 | bool Order::ShouldStopAtStation(const Vehicle *v, StationID station) const |
| 2177 | { |
| 2178 | bool is_dest_station = this->IsType(OT_GOTO_STATION) && this->dest == station; |
| 2179 | |
| 2180 | return (!this->IsType(OT_GOTO_DEPOT) || this->GetDepotOrderType().Test(OrderDepotTypeFlag::PartOfOrders)) && |
| 2181 | v->last_station_visited != station && // Do stop only when we've not just been there |
| 2182 | /* Finally do stop when there is no non-stop flag set for this type of station. */ |
| 2183 | !this->GetNonStopType().Test(is_dest_station ? OrderNonStopFlag::NoDestination : OrderNonStopFlag::NoIntermediate); |
| 2184 | } |
| 2185 | |
| 2186 | bool Order::CanLoadOrUnload() const |
| 2187 | { |
no test coverage detected