(svn r773) When refitting a train engine, refit also all the attached wagons which can be refitted (applicable to DBSetXL, as shown in http://pasky.or.cz/~pasky/dev/openttd/screenshots/wagrefit.png). This is how TTDPatch does it, pointed out by Bjarni.
authorpasky
Mon, 22 Nov 2004 23:05:34 +0000
changeset 491 0642006d876c
parent 490 83455cd1cc55
child 492 7efeead48c37
(svn r773) When refitting a train engine, refit also all the attached wagons which can be refitted (applicable to DBSetXL, as shown in http://pasky.or.cz/~pasky/dev/openttd/screenshots/wagrefit.png). This is how TTDPatch does it, pointed out by Bjarni.
train_cmd.c
--- a/train_cmd.c	Mon Nov 22 22:52:01 2004 +0000
+++ b/train_cmd.c	Mon Nov 22 23:05:34 2004 +0000
@@ -1037,7 +1037,12 @@
 	num = 0;
 
 	do {
-		if (!(_rail_vehicle_info[v->engine_type].flags & RVI_WAGON) && (byte)p2 != v->cargo_type && v->cargo_cap != 0) {
+		/* XXX: We also 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. --pasky */
+		if ((!(_rail_vehicle_info[v->engine_type].flags & RVI_WAGON)
+		     || (_engine_refit_masks[v->engine_type] & (1 << p2)))
+		    && (byte) p2 != v->cargo_type && v->cargo_cap != 0) {
 			cost += (_price.build_railvehicle >> 8);
 			num += v->cargo_cap;
 			if (flags & DC_EXEC) {