From 90ad445802729ecb4d06972e922a75f419cff392 Mon Sep 17 00:00:00 2001 From: Tyler Trahan Date: Mon, 15 Sep 2025 19:05:35 -0400 Subject: [PATCH] Fix #14588: Show error when unable to clone partly-cleared crashed train (#14591) --- src/vehicle_cmd.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index 93f665d4bd..c27fb92ded 100644 --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -849,7 +849,8 @@ std::tuple CmdCloneVehicle(DoCommandFlags flags, TileInd CommandCost ret = CheckOwnership(v->owner); if (ret.Failed()) return { ret, VehicleID::Invalid() }; - if (v->type == VEH_TRAIN && (!v->IsFrontEngine() || Train::From(v)->crash_anim_pos >= 4400)) return { CMD_ERROR, VehicleID::Invalid() }; + /* Crashed trains can only be cloned before cleanup begins. */ + if (v->type == VEH_TRAIN && (!v->IsFrontEngine() || Train::From(v)->crash_anim_pos >= 4400)) return { CommandCost(STR_ERROR_VEHICLE_IS_DESTROYED), VehicleID::Invalid() }; /* check that we can allocate enough vehicles */ if (!flags.Test(DoCommandFlag::Execute)) {