summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2006-08-12 10:41:29 +0000
committerbjarni <bjarni@openttd.org>2006-08-12 10:41:29 +0000
commit1e47593786e33fd4b06f79c354ae460ca61e4594 (patch)
tree6cdfd2c36fdf36dd3317a87b23274349ba2c5cdd
parent52124f27d4323e3119cbfc983639e85f6abc9022 (diff)
downloadopenttd-1e47593786e33fd4b06f79c354ae460ca61e4594.tar.xz
(svn r5853) -Fix: [elrails] FS#178 Electric Trains can leave Conventional Depot
now the user will get an error if he tries to start the train and the status bar will say "no power" instead of "stopped" Electric trains already driving in and out of non-electrified depots will still do so, but you can't start new ones
-rw-r--r--lang/english.txt2
-rw-r--r--train_cmd.c2
-rw-r--r--train_gui.c6
3 files changed, 9 insertions, 1 deletions
diff --git a/lang/english.txt b/lang/english.txt
index 820340e87..7a4c07382 100644
--- a/lang/english.txt
+++ b/lang/english.txt
@@ -2529,6 +2529,8 @@ STR_886F_TRANSFER :{BLACK}Transfer
STR_TRAIN_STOPPING :{RED}Stopping
STR_TRAIN_STOPPING_VEL :{RED}Stopping, {VELOCITY}
STR_INCOMPATIBLE_RAIL_TYPES :Incompatible rail types
+STR_TRAIN_NO_POWER :{RED}No power
+STR_TRAIN_START_NO_CATENARY :This track lacks catenary, so the train can't start
##id 0x9000
STR_9000_ROAD_VEHICLE_IN_THE_WAY :{WHITE}Road vehicle in the way
diff --git a/train_cmd.c b/train_cmd.c
index 8afe5d75b..d36449b34 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -1243,6 +1243,8 @@ int32 CmdStartStopTrain(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
return_cmd_error(error);
}
+ if (v->vehstatus & VS_STOPPED && v->u.rail.cached_power == 0) return_cmd_error(STR_TRAIN_START_NO_CATENARY);
+
if (flags & DC_EXEC) {
if (v->vehstatus & VS_STOPPED && v->u.rail.track == 0x80) {
DeleteVehicleNews(p1, STR_8814_TRAIN_IS_WAITING_IN_DEPOT);
diff --git a/train_gui.c b/train_gui.c
index 1a3542a2a..376556071 100644
--- a/train_gui.c
+++ b/train_gui.c
@@ -954,7 +954,11 @@ static void TrainViewWndProc(Window *w, WindowEvent *e)
str = STR_885C_BROKEN_DOWN;
} else if (v->vehstatus & VS_STOPPED) {
if (v->u.rail.last_speed == 0) {
- str = STR_8861_STOPPED;
+ if (v->u.rail.cached_power == 0) {
+ str = STR_TRAIN_NO_POWER;
+ } else {
+ str = STR_8861_STOPPED;
+ }
} else {
SetDParam(0, v->u.rail.last_speed);
str = STR_TRAIN_STOPPING + _patches.vehicle_speed;