Changeset - r491:97901345ef96
[Not reviewed]
master
0 1 0
pasky - 20 years ago 2004-11-22 23:05:34
pasky@openttd.org
(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.
1 file changed with 6 insertions and 1 deletions:
0 comments (0 inline, 0 general)
train_cmd.c
Show inline comments
 
@@ -1037,7 +1037,12 @@ int32 CmdRefitRailVehicle(int x, int y, 
 
	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) {
0 comments (0 inline, 0 general)