summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-05-06 13:15:07 +0000
committerfrosch <frosch@openttd.org>2009-05-06 13:15:07 +0000
commitff7f2bdb20794855ea398854a92e2ee40aeba879 (patch)
tree439c854ea37b911a575044ca58a5fda18cba303a
parentfe5defbaccb401f94662513c30fbf372b6944153 (diff)
downloadopenttd-ff7f2bdb20794855ea398854a92e2ee40aeba879.tar.xz
(svn r16240) -Fix: Make 'stop in depot'-orders only apply on the target depot, not those which are entered on the way to them.
-rw-r--r--src/vehicle.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index d3b8020ba..0df21e8c5 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -600,11 +600,8 @@ Vehicle::~Vehicle()
*/
void VehicleEnteredDepotThisTick(Vehicle *v)
{
- /* Vehicle should stop in the depot if it was in 'stopping' state or
- * when the vehicle is ordered to halt in the depot. */
- _vehicles_to_autoreplace[v] = !(v->vehstatus & VS_STOPPED) &&
- (!v->current_order.IsType(OT_GOTO_DEPOT) ||
- !(v->current_order.GetDepotActionType() & ODATFB_HALT));
+ /* Vehicle should stop in the depot if it was in 'stopping' state */
+ _vehicles_to_autoreplace[v] = !(v->vehstatus & VS_STOPPED);
/* We ALWAYS set the stopped state. Even when the vehicle does not plan on
* stopping in the depot, so we stop it to ensure that it will not reserve
@@ -1073,8 +1070,8 @@ void VehicleEnterDepot(Vehicle *v)
v->cur_order_index++;
}
if (t.GetDepotActionType() & ODATFB_HALT) {
- /* Force depot visit */
- v->vehstatus |= VS_STOPPED;
+ /* Vehicles are always stopped on entering depots. Do not restart this one. */
+ _vehicles_to_autoreplace[v] = false;
if (v->owner == _local_company) {
StringID string;