summaryrefslogtreecommitdiff
path: root/src/order_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2008-04-15 12:25:35 +0000
committerfrosch <frosch@openttd.org>2008-04-15 12:25:35 +0000
commit93afe8100167db671cf3391c07744d5119a01bf3 (patch)
tree698911f4da9bef1f779ffbe3049f1bbdcdbd99ab /src/order_cmd.cpp
parentbd3e5d9c43361bd67eb95897603d7fc644b13ea3 (diff)
downloadopenttd-93afe8100167db671cf3391c07744d5119a01bf3.tar.xz
(svn r12716) -Fix: Do not compare StationIDs with DepotIDs or WaypointIDs.
Diffstat (limited to 'src/order_cmd.cpp')
-rw-r--r--src/order_cmd.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp
index ccb104d2a..b6e483d4c 100644
--- a/src/order_cmd.cpp
+++ b/src/order_cmd.cpp
@@ -1614,7 +1614,7 @@ bool ProcessOrders(Vehicle *v)
}
/* Check if we've reached a non-stop station.. */
- if ((v->current_order.GetNonStopType() & ONSF_NO_STOP_AT_DESTINATION_STATION) &&
+ if (v->current_order.IsType(OT_GOTO_STATION) && (v->current_order.GetNonStopType() & ONSF_NO_STOP_AT_DESTINATION_STATION) &&
IsTileType(v->tile, MP_STATION) &&
v->current_order.GetDestination() == GetStationIndex(v->tile)) {
v->last_station_visited = v->current_order.GetDestination();
@@ -1742,10 +1742,11 @@ bool ProcessOrders(Vehicle *v)
*/
bool Order::ShouldStopAtStation(const Vehicle *v, StationID station) const
{
+ bool is_dest_station = this->IsType(OT_GOTO_STATION) && this->dest == station;
return
v->last_station_visited != station && // Do stop only when we've not just been there
/* Finally do stop when there is no non-stop flag set for this type of station. */
- !(this->GetNonStopType() & ((this->dest == station) ? ONSF_NO_STOP_AT_DESTINATION_STATION : ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS));
+ !(this->GetNonStopType() & (is_dest_station ? ONSF_NO_STOP_AT_DESTINATION_STATION : ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS));
}
void InitializeOrders()