mirror of https://github.com/OpenTTD/OpenTTD
Fix #10223: Crash when vehicle cloning fails on order cloning.
parent
985f487065
commit
d5fc423793
|
@ -958,7 +958,7 @@ std::tuple<CommandCost, VehicleID> CmdCloneVehicle(DoCommandFlag flags, TileInde
|
||||||
if (result.Failed()) {
|
if (result.Failed()) {
|
||||||
/* The vehicle has already been bought, so now it must be sold again. */
|
/* The vehicle has already been bought, so now it must be sold again. */
|
||||||
Command<CMD_SELL_VEHICLE>::Do(flags, w_front->index, true, false, INVALID_CLIENT_ID);
|
Command<CMD_SELL_VEHICLE>::Do(flags, w_front->index, true, false, INVALID_CLIENT_ID);
|
||||||
return { total_cost, INVALID_VEHICLE };
|
return { result, INVALID_VEHICLE };
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now clone the vehicle's name, if it has one. */
|
/* Now clone the vehicle's name, if it has one. */
|
||||||
|
|
Loading…
Reference in New Issue