summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/vehicle_cmd.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp
index a5eb2087b..7383e1d4a 100644
--- a/src/vehicle_cmd.cpp
+++ b/src/vehicle_cmd.cpp
@@ -151,7 +151,8 @@ CommandCost CmdBuildVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
}
if (refitting) {
- value.AddCost(CmdRefitVehicle(tile, flags, v->index, cargo, nullptr));
+ /* Refit only one vehicle. If we purchased an engine, it may have gained free wagons. */
+ value.AddCost(CmdRefitVehicle(tile, flags, v->index, cargo | (1 << 16), nullptr));
} else {
/* Fill in non-refitted capacities */
_returned_refit_capacity = e->GetDisplayDefaultCapacity(&_returned_mail_refit_capacity);