From 33e3e571d3298132dee8393db3766c0919daaf58 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Wed, 7 Sep 2022 19:42:55 +0100 Subject: [PATCH] Return specific error when wagon purchase fails due to wrong depot type See: #419 --- src/train_cmd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 46711c8b89..18bc085150 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -1419,7 +1419,7 @@ static CommandCost CmdBuildRailWagon(TileIndex tile, DoCommandFlag flags, const const RailVehicleInfo *rvi = &e->u.rail; /* Check that the wagon can drive on the track in question */ - if (!IsCompatibleRail(rvi->railtype, GetRailType(tile))) return CMD_ERROR; + if (!IsCompatibleRail(rvi->railtype, GetRailType(tile))) return_cmd_error(STR_ERROR_DEPOT_HAS_WRONG_RAIL_TYPE); if (flags & DC_EXEC) { Train *v = new Train();