summaryrefslogtreecommitdiff
path: root/src/vehicle.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-04-07 08:59:04 +0000
committerrubidium <rubidium@openttd.org>2008-04-07 08:59:04 +0000
commitfcdd44b662dc011069b2ec19c3f46a5e9eaa7471 (patch)
treee49996b3a01b39c141422d537b97922f7c2956ee /src/vehicle.cpp
parent76eaed68a07fb0134c99100a0fb49e884b511244 (diff)
downloadopenttd-fcdd44b662dc011069b2ec19c3f46a5e9eaa7471.tar.xz
(svn r12600) -Codechange: make GetNonStopType return a more augmented type; not is there a non-stop order but the kind of non-stop order, so one doesn't need to check _patches.new_nonstop type everywhere.
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r--src/vehicle.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index 03bd7113b..50130ffe5 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -3138,12 +3138,12 @@ void Vehicle::BeginLoading()
* necessary to be known for HandleTrainLoading to determine
* whether the train is lost or not; not marking a train lost
* that arrives at random stations is bad. */
- this->current_order.SetNonStopType(OFB_NON_STOP);
+ this->current_order.SetNonStopType(ONSF_NO_STOP_AT_ANY_STATION);
current_order.MakeLoading(true);
UpdateVehicleTimetable(this, true);
} else {
- this->current_order.SetNonStopType(OFB_NO_NON_STOP);
+ this->current_order.SetNonStopType(ONSF_STOP_EVERYWHERE);
current_order.MakeLoading(false);
}
@@ -3165,7 +3165,7 @@ void Vehicle::LeaveStation()
assert(current_order.IsType(OT_LOADING));
/* Only update the timetable if the vehicle was supposed to stop here. */
- if (current_order.GetNonStopType() != OFB_NO_NON_STOP) UpdateVehicleTimetable(this, false);
+ if (current_order.GetNonStopType() != ONSF_STOP_EVERYWHERE) UpdateVehicleTimetable(this, false);
current_order.MakeLeaveStation();
GetStation(this->last_station_visited)->loading_vehicles.remove(this);
@@ -3187,11 +3187,11 @@ void Vehicle::HandleLoading(bool mode)
this->PlayLeaveStationSound();
- Order b = this->current_order;
+ bool at_destination_station = this->current_order.GetNonStopType() != ONSF_STOP_EVERYWHERE;
this->LeaveStation();
/* If this was not the final order, don't remove it from the list. */
- if (!(b.GetNonStopType() & OFB_NON_STOP)) return;
+ if (!at_destination_station) return;
break;
}