summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-04-19 21:23:42 +0000
committerrubidium <rubidium@openttd.org>2008-04-19 21:23:42 +0000
commita63974547b89f7754d00d8016b08abb682c34036 (patch)
treecf8a33b9dcd8790707e287a00b315f9ab5d7d328
parentfa549be09ed2300bc53d62d7cbe50a9ccc76c628 (diff)
downloadopenttd-a63974547b89f7754d00d8016b08abb682c34036.tar.xz
(svn r12795) -Fix [FS#1938]: vehicles could break down during loading and keep loading. The intention of the break down code is not to break down when having zero speed, therefor break downs now do not happen when loading.
-rw-r--r--src/aircraft_cmd.cpp2
-rw-r--r--src/roadveh_cmd.cpp2
-rw-r--r--src/ship_cmd.cpp2
-rw-r--r--src/train_cmd.cpp2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp
index b1f4967a0..c45c9d282 100644
--- a/src/aircraft_cmd.cpp
+++ b/src/aircraft_cmd.cpp
@@ -2086,7 +2086,7 @@ static void AircraftEventHandler(Vehicle *v, int loop)
if (v->breakdown_ctr <= 2) {
HandleBrokenAircraft(v);
} else {
- v->breakdown_ctr--;
+ if (!v->current_order.IsType(OT_LOADING)) v->breakdown_ctr--;
}
}
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index a1c083447..78a5d5ee2 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -1844,7 +1844,7 @@ static void RoadVehController(Vehicle *v)
HandleBrokenRoadVeh(v);
return;
}
- v->breakdown_ctr--;
+ if (!v->current_order.IsType(OT_LOADING)) v->breakdown_ctr--;
}
if (v->vehstatus & VS_STOPPED) return;
diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp
index ac00f121b..901514727 100644
--- a/src/ship_cmd.cpp
+++ b/src/ship_cmd.cpp
@@ -594,7 +594,7 @@ static void ShipController(Vehicle *v)
HandleBrokenShip(v);
return;
}
- v->breakdown_ctr--;
+ if (!v->current_order.IsType(OT_LOADING)) v->breakdown_ctr--;
}
if (v->vehstatus & VS_STOPPED) return;
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 751cc1889..cf6478b4c 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -3421,7 +3421,7 @@ static void TrainLocoHandler(Vehicle *v, bool mode)
HandleBrokenTrain(v);
return;
}
- v->breakdown_ctr--;
+ if (!v->current_order.IsType(OT_LOADING)) v->breakdown_ctr--;
}
if (HasBit(v->u.rail.flags, VRF_REVERSING) && v->cur_speed == 0) {