summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2006-04-01 15:11:30 +0000
committerbjarni <bjarni@openttd.org>2006-04-01 15:11:30 +0000
commit10358a773e77ef2b2c68a2488a8362c55ea63ed0 (patch)
tree8f07c678e717418dacedfe4bbb3647b704076c2b
parent98c77c363f4c2d0b5aaa49d1566260f9deaf4bfb (diff)
downloadopenttd-10358a773e77ef2b2c68a2488a8362c55ea63ed0.tar.xz
(svn r4228) -Fix: [autoreplace] allow replacement of wagons even when the engine fails to be replaced
-rw-r--r--vehicle.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/vehicle.c b/vehicle.c
index cb7ba6a98..6950b0e7c 100644
--- a/vehicle.c
+++ b/vehicle.c
@@ -1781,12 +1781,12 @@ static void MaybeReplaceVehicle(Vehicle *v)
v = w;
}
- if (CmdFailed(temp_cost)) break;
-
- cost += temp_cost;
+ if (!CmdFailed(temp_cost)) {
+ cost += temp_cost;
+ }
} while (w->type == VEH_Train && (w = GetNextVehicle(w)) != NULL);
- if (!(flags & DC_EXEC) && (CmdFailed(temp_cost) || p->money64 < (int32)(cost + p->engine_renew_money) || cost == 0)) {
+ if (p->money64 < (int32)(cost + p->engine_renew_money) || cost == 0) {
if (p->money64 < (int32)(cost + p->engine_renew_money) && ( _local_player == v->owner ) && cost != 0) {
StringID message;
SetDParam(0, v->unitnumber);