equal
deleted
inserted
replaced
1612 UpdateVehicleTimetable(v, true); |
1612 UpdateVehicleTimetable(v, true); |
1613 v->cur_order_index++; |
1613 v->cur_order_index++; |
1614 } |
1614 } |
1615 |
1615 |
1616 /* Check if we've reached a non-stop station.. */ |
1616 /* Check if we've reached a non-stop station.. */ |
1617 if ((v->current_order.GetNonStopType() & ONSF_NO_STOP_AT_DESTINATION_STATION) && |
1617 if (v->current_order.IsType(OT_GOTO_STATION) && (v->current_order.GetNonStopType() & ONSF_NO_STOP_AT_DESTINATION_STATION) && |
1618 IsTileType(v->tile, MP_STATION) && |
1618 IsTileType(v->tile, MP_STATION) && |
1619 v->current_order.GetDestination() == GetStationIndex(v->tile)) { |
1619 v->current_order.GetDestination() == GetStationIndex(v->tile)) { |
1620 v->last_station_visited = v->current_order.GetDestination(); |
1620 v->last_station_visited = v->current_order.GetDestination(); |
1621 UpdateVehicleTimetable(v, true); |
1621 UpdateVehicleTimetable(v, true); |
1622 v->cur_order_index++; |
1622 v->cur_order_index++; |
1740 * @param station the station to stop at. |
1740 * @param station the station to stop at. |
1741 * @return true if the vehicle should stop. |
1741 * @return true if the vehicle should stop. |
1742 */ |
1742 */ |
1743 bool Order::ShouldStopAtStation(const Vehicle *v, StationID station) const |
1743 bool Order::ShouldStopAtStation(const Vehicle *v, StationID station) const |
1744 { |
1744 { |
|
1745 bool is_dest_station = this->IsType(OT_GOTO_STATION) && this->dest == station; |
1745 return |
1746 return |
1746 v->last_station_visited != station && // Do stop only when we've not just been there |
1747 v->last_station_visited != station && // Do stop only when we've not just been there |
1747 /* Finally do stop when there is no non-stop flag set for this type of station. */ |
1748 /* Finally do stop when there is no non-stop flag set for this type of station. */ |
1748 !(this->GetNonStopType() & ((this->dest == station) ? ONSF_NO_STOP_AT_DESTINATION_STATION : ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS)); |
1749 !(this->GetNonStopType() & (is_dest_station ? ONSF_NO_STOP_AT_DESTINATION_STATION : ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS)); |
1749 } |
1750 } |
1750 |
1751 |
1751 void InitializeOrders() |
1752 void InitializeOrders() |
1752 { |
1753 { |
1753 _Order_pool.CleanPool(); |
1754 _Order_pool.CleanPool(); |