(svn r4228) -Fix: [autoreplace] allow replacement of wagons even when the engine fails to be replaced
authorbjarni
Sat, 01 Apr 2006 15:11:30 +0000
changeset 3413 bebbb9d71cc8
parent 3412 f1dc9f094c2a
child 3414 d728e3793041
(svn r4228) -Fix: [autoreplace] allow replacement of wagons even when the engine fails to be replaced
vehicle.c
--- a/vehicle.c	Sat Apr 01 14:53:38 2006 +0000
+++ b/vehicle.c	Sat Apr 01 15:11:30 2006 +0000
@@ -1781,12 +1781,12 @@
 				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);