Return specific error when wagon purchase fails due to wrong depot type

See: #419
This commit is contained in:
Jonathan G Rennison
2022-09-07 19:42:55 +01:00
parent a97d5cb333
commit 33e3e571d3

View File

@@ -1419,7 +1419,7 @@ static CommandCost CmdBuildRailWagon(TileIndex tile, DoCommandFlag flags, const
const RailVehicleInfo *rvi = &e->u.rail; const RailVehicleInfo *rvi = &e->u.rail;
/* Check that the wagon can drive on the track in question */ /* 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) { if (flags & DC_EXEC) {
Train *v = new Train(); Train *v = new Train();