changeset 2854:05aece5cea28 draft

(svn r3402) -Fix: [building/cloning] added a string telling if build failed due to not being able to build a vehicle. Triggered when cloning a retired design
author bjarni <bjarni@openttd.org>
date Wed, 18 Jan 2006 14:12:26 +0000
parents ebaa8248b16e
children 5fd1c02a62f3
files aircraft_cmd.c lang/english.txt roadveh_cmd.c ship_cmd.c train_cmd.c
diffstat 5 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/aircraft_cmd.c
+++ b/aircraft_cmd.c
@@ -141,7 +141,7 @@
 	const AircraftVehicleInfo *avi;
 	Engine *e;
 
-	if (!IsEngineBuildable(p1, VEH_Aircraft)) return CMD_ERROR;
+	if (!IsEngineBuildable(p1, VEH_Aircraft)) return_cmd_error(STR_ENGINE_NOT_BUILDABLE);
 
 	value = EstimateAircraftCost(p1);
 
--- a/lang/english.txt
+++ b/lang/english.txt
@@ -2760,6 +2760,7 @@
 STR_REPLACE_HELP                                                :{BLACK}This allows you to replace one engine type with another type, when trains of the original type enter a depot
 STR_REPLACE_REMOVE_WAGON                                        :{BLACK}Wagon removal: {ORANGE}{SKIP}{STRING}
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}Make autoreplace keep the length of a train the same by removing wagons (starting at the front), if replacing the engine would make the train longer.
+STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}Engine is not buildable
 
 STR_SHORT_DATE                                                  :{WHITE}{DATE_TINY}
 STR_SIGN_LIST_CAPTION                                           :{WHITE}Sign List - {COMMA} Sign{P "" s}
--- a/roadveh_cmd.c
+++ b/roadveh_cmd.c
@@ -111,7 +111,7 @@
 	TileIndex tile = TileVirtXY(x, y);
 	Engine *e;
 
-	if (!IsEngineBuildable(p1, VEH_Road)) return CMD_ERROR;
+	if (!IsEngineBuildable(p1, VEH_Road)) return_cmd_error(STR_ENGINE_NOT_BUILDABLE);
 
 	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
 
--- a/ship_cmd.c
+++ b/ship_cmd.c
@@ -827,7 +827,7 @@
 	TileIndex tile = TileVirtXY(x, y);
 	Engine *e;
 
-	if (!IsEngineBuildable(p1, VEH_Ship)) return CMD_ERROR;
+	if (!IsEngineBuildable(p1, VEH_Ship)) return_cmd_error(STR_ENGINE_NOT_BUILDABLE);
 
 	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
 
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -674,7 +674,7 @@
 	uint num_vehicles;
 
 	/* Check if the engine-type is valid (for the player) */
-	if (!IsEngineBuildable(p1, VEH_Train)) return CMD_ERROR;
+	if (!IsEngineBuildable(p1, VEH_Train)) return_cmd_error(STR_ENGINE_NOT_BUILDABLE);
 
 	/* Check if the train is actually being built in a depot belonging
 	 * to the player. Doesn't matter if only the cost is queried */