summaryrefslogtreecommitdiff
path: root/train_cmd.c
diff options
context:
space:
mode:
authorpasky <pasky@openttd.org>2004-11-22 23:05:34 +0000
committerpasky <pasky@openttd.org>2004-11-22 23:05:34 +0000
commit2214a9df5c6164e4f2ebe4fd42565262b748852c (patch)
tree595b61fe5a49e68020c7550d22cf1c9942ec94f5 /train_cmd.c
parent34c89d689600f22aeb52acb6b5a61ea2e276e619 (diff)
downloadopenttd-2214a9df5c6164e4f2ebe4fd42565262b748852c.tar.xz
(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.
Diffstat (limited to 'train_cmd.c')
-rw-r--r--train_cmd.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/train_cmd.c b/train_cmd.c
index 82f837d81..fcb2837c6 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -1037,7 +1037,12 @@ int32 CmdRefitRailVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
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) {