summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2006-01-18 14:12:26 +0000
committerbjarni <bjarni@openttd.org>2006-01-18 14:12:26 +0000
commitb87b5f1187b3b31b9085f008017a65693654b67b (patch)
treeaa2503d834088b8d7eb5a8105c69d71cbb815c45
parent8403f2bd336a95c2d907ed1c6b2a2d47a5d940bf (diff)
downloadopenttd-b87b5f1187b3b31b9085f008017a65693654b67b.tar.xz
(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
-rw-r--r--aircraft_cmd.c2
-rw-r--r--lang/english.txt1
-rw-r--r--roadveh_cmd.c2
-rw-r--r--ship_cmd.c2
-rw-r--r--train_cmd.c2
5 files changed, 5 insertions, 4 deletions
diff --git a/aircraft_cmd.c b/aircraft_cmd.c
index 668174314..5a5392c6b 100644
--- a/aircraft_cmd.c
+++ b/aircraft_cmd.c
@@ -141,7 +141,7 @@ int32 CmdBuildAircraft(int x, int y, uint32 flags, uint32 p1, uint32 p2)
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);
diff --git a/lang/english.txt b/lang/english.txt
index 5d648f0c5..637ef3e5c 100644
--- a/lang/english.txt
+++ b/lang/english.txt
@@ -2760,6 +2760,7 @@ STR_REPLACE_HELP_REPLACE_INFO_TAB :{BLACK}Displays
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}
diff --git a/roadveh_cmd.c b/roadveh_cmd.c
index f1913c13e..ac5c40248 100644
--- a/roadveh_cmd.c
+++ b/roadveh_cmd.c
@@ -111,7 +111,7 @@ int32 CmdBuildRoadVeh(int x, int y, uint32 flags, uint32 p1, uint32 p2)
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);
diff --git a/ship_cmd.c b/ship_cmd.c
index bf18bdd9a..b73b48380 100644
--- a/ship_cmd.c
+++ b/ship_cmd.c
@@ -827,7 +827,7 @@ int32 CmdBuildShip(int x, int y, uint32 flags, uint32 p1, uint32 p2)
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);
diff --git a/train_cmd.c b/train_cmd.c
index 115bc5b73..f1f444252 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -674,7 +674,7 @@ int32 CmdBuildRailVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
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 */