From 0e624275ee1caa6500215e2747cdae7f53a941a5 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 19 Apr 2008 21:23:42 +0000 Subject: (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. --- src/aircraft_cmd.cpp | 2 +- src/roadveh_cmd.cpp | 2 +- src/ship_cmd.cpp | 2 +- src/train_cmd.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') 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) { -- cgit v1.2.3-70-g09d2