From fcdd44b662dc011069b2ec19c3f46a5e9eaa7471 Mon Sep 17 00:00:00 2001 From: rubidium Date: Mon, 7 Apr 2008 08:59:04 +0000 Subject: (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. --- src/vehicle.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/vehicle.cpp') 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; } -- cgit v1.2.3-54-g00ecf