From 0f9dc88834fd6b44a62b1f3395e71653008f69e9 Mon Sep 17 00:00:00 2001 From: frosch Date: Sun, 3 May 2020 22:05:13 +0200 Subject: Fix: When build+refit an engine, do not refit any free wagons that may get attached. --- src/vehicle_cmd.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') 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); -- cgit v1.2.3-70-g09d2