1
0
Fork 0

Fix: When build+refit an engine, do not refit any free wagons that may get attached.

pull/8287/head
frosch 2020-05-03 22:05:13 +02:00 committed by Charles Pigott
parent e90322f6e9
commit 591ca82845
1 changed files with 2 additions and 1 deletions

View File

@ -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);