From d5fc423793935c5411b71e680fa177b5ba58bd0e Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Wed, 7 Dec 2022 23:18:44 +0100 Subject: [PATCH] Fix #10223: Crash when vehicle cloning fails on order cloning. --- src/vehicle_cmd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index 373a92cdbf..ed7cf56689 100644 --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -958,7 +958,7 @@ std::tuple CmdCloneVehicle(DoCommandFlag flags, TileInde if (result.Failed()) { /* The vehicle has already been bought, so now it must be sold again. */ Command::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. */