summaryrefslogtreecommitdiff
path: root/src/train_cmd.cpp
diff options
context:
space:
mode:
authormaedhros <maedhros@openttd.org>2007-04-29 08:43:00 +0000
committermaedhros <maedhros@openttd.org>2007-04-29 08:43:00 +0000
commit8acc58b731493bc7f08210fc24b80607728d63fb (patch)
tree559214dc543888bbb895568ad27800695218f8d8 /src/train_cmd.cpp
parent55a4e4f756de8864f0ca912d0b5de8f8f83432ae (diff)
downloadopenttd-8acc58b731493bc7f08210fc24b80607728d63fb.tar.xz
(svn r9742) -Fix (r9689) [FS#739]: Fix cloning with refit costs again, hopefully for good this time.
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r--src/train_cmd.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index bbdb77547..c3eedc2c5 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -1751,11 +1751,14 @@ int32 CmdForceTrainProceed(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
* param p2 various bitstuffed elements
* - p2 = (bit 0-7) - the new cargo type to refit to
* - p2 = (bit 8-15) - the new cargo subtype to refit to
+ * - p2 = (bit 16) - refit only this vehicle
+ * @return cost of refit or error
*/
int32 CmdRefitRailVehicle(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
CargoID new_cid = GB(p2, 0, 8);
byte new_subtype = GB(p2, 8, 8);
+ bool only_this = HASBIT(p2, 16);
if (!IsValidVehicleID(p1)) return CMD_ERROR;
@@ -1833,7 +1836,7 @@ int32 CmdRefitRailVehicle(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
}
}
}
- } while ((v = v->next) != NULL);
+ } while ((v = v->next) != NULL && !only_this);
_returned_refit_capacity = num;