diff options
author | rubidium <rubidium@openttd.org> | 2008-04-07 08:59:04 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-04-07 08:59:04 +0000 |
commit | c57a1d74c3e083a24505fad78ce216500adf82ee (patch) | |
tree | e49996b3a01b39c141422d537b97922f7c2956ee /src/vehicle.cpp | |
parent | 6af1fb2bdd32898d9456174d99413adf3e466797 (diff) | |
download | openttd-c57a1d74c3e083a24505fad78ce216500adf82ee.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.cpp | 10 |
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; } |