Skip to content

Commit

Permalink
Fix build and refit with multi-cargo ships only refitting first part
Browse files Browse the repository at this point in the history
  • Loading branch information
JGRennison committed Feb 1, 2024
1 parent a5a315b commit b49a38b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/vehicle_cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,9 @@ CommandCost CmdBuildVehicle(TileIndex tile, DoCommandFlag flags, uint32_t p1, ui
}

if (refitting) {
/* 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));
/* Refit only one vehicle. If we purchased an engine, it may have gained free wagons.
* For ships try to refit all parts. */
value.AddCost(CmdRefitVehicle(tile, flags, v->index, cargo | (v->type == VEH_SHIP ? 0 : (1 << 16)), nullptr));
} else {
/* Fill in non-refitted capacities */
if (e->type == VEH_TRAIN || e->type == VEH_ROAD || e->type == VEH_SHIP) {
Expand Down

0 comments on commit b49a38b

Please sign in to comment.