diff options
Diffstat (limited to 'src/vehicle_cmd.cpp')
-rw-r--r-- | src/vehicle_cmd.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index 32706837f..9da6b89ce 100644 --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -987,16 +987,14 @@ CommandCost CmdCloneVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint /* Now clone the vehicle's name, if it has one. */ if (!v_front->name.empty()) CloneVehicleName(v_front, w_front); - } - /* Since we can't estimate the cost of cloning a vehicle accurately we must - * check whether the company has enough money manually. */ - if (!CheckCompanyHasMoney(total_cost)) { - if (flags & DC_EXEC) { + /* Since we can't estimate the cost of cloning a vehicle accurately we must + * check whether the company has enough money manually. */ + if (!CheckCompanyHasMoney(total_cost)) { /* The vehicle has already been bought, so now it must be sold again. */ DoCommand(w_front->tile, w_front->index | 1 << 20, 0, flags, GetCmdSellVeh(w_front)); + return total_cost; } - return total_cost; } return total_cost; |