summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-02-21 11:54:25 +0000
committerfrosch <frosch@openttd.org>2009-02-21 11:54:25 +0000
commitb674d1f6f5c680d42c3297f1a79a87a124d0e52d (patch)
tree780a386351ebb98d0ab3f837a60dbe54f3129b9d
parent85333d4211d449f0ccc5ef6cbb928e7f7773d70e (diff)
downloadopenttd-b674d1f6f5c680d42c3297f1a79a87a124d0e52d.tar.xz
(svn r15540) -Fix: Testing of 'only_this' in CmdRefitRoadVeh() could be skipped by 'continue'.
-rw-r--r--src/roadveh_cmd.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index 40dcf3e18..a15581a47 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -2003,7 +2003,7 @@ CommandCost CmdRefitRoadVeh(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
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 @@ CommandCost CmdRefitRoadVeh(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
InvalidateWindowClassesData(WC_ROADVEH_LIST, 0);
}
-
- if (only_this) break;
}
if (flags & DC_EXEC) RoadVehUpdateCache(GetVehicle(p1)->First());