changeset 11187:de2a88d84521 draft

(svn r15540) -Fix: Testing of 'only_this' in CmdRefitRoadVeh() could be skipped by 'continue'.
author frosch <frosch@openttd.org>
date Sat, 21 Feb 2009 11:54:25 +0000
parents 006c163c83a5
children 9e451d497d94
files src/roadveh_cmd.cpp
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -2003,7 +2003,7 @@
 
 	if (new_cid >= NUM_CARGO) return CMD_ERROR;
 
-	for (; v != NULL; v = v->Next()) {
+	for (; v != NULL; v = (only_this ? NULL : v->Next())) {
 		/* XXX: We refit all the attached wagons en-masse if they can be
 		 * refitted. This is how TTDPatch does it.  TODO: Have some nice
 		 * [Refit] button near each wagon. */
@@ -2065,8 +2065,6 @@
 			InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
 			InvalidateWindowClassesData(WC_ROADVEH_LIST, 0);
 		}
-
-		if (only_this) break;
 	}
 
 	if (flags & DC_EXEC) RoadVehUpdateCache(GetVehicle(p1)->First());