summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2010-02-21 20:55:31 +0000
committeralberth <alberth@openttd.org>2010-02-21 20:55:31 +0000
commit5052777d0bbbd2322d4bfe2afc3914b9afe26f0d (patch)
tree9179a1c78734aba82fc016dd533d0317bbb7756d /src
parent2b07389fe66471c48d7cd6bdcd96cbe98327e90c (diff)
downloadopenttd-5052777d0bbbd2322d4bfe2afc3914b9afe26f0d.tar.xz
(svn r19190) -Add: Improve error message with track building when signals are in the way.
Diffstat (limited to 'src')
-rw-r--r--src/lang/english.txt1
-rw-r--r--src/rail_cmd.cpp4
2 files changed, 4 insertions, 1 deletions
diff --git a/src/lang/english.txt b/src/lang/english.txt
index 6b46ebd12..12f64aac5 100644
--- a/src/lang/english.txt
+++ b/src/lang/english.txt
@@ -3474,6 +3474,7 @@ STR_ERROR_AUTOREPLACE_MONEY_LIMIT :(money limit)
# Rail construction errors
STR_ERROR_IMPOSSIBLE_TRACK_COMBINATION :{WHITE}Impossible track combination
+STR_ERROR_MUST_REMOVE_SIGNALS_FIRST :{WHITE}Must remove signals first
STR_ERROR_NO_SUITABLE_RAILROAD_TRACK :{WHITE}No suitable railway track
STR_ERROR_MUST_REMOVE_RAILROAD_TRACK :{WHITE}Must remove railway track first
STR_ERROR_CROSSING_ON_ONEWAY_ROAD :{WHITE}Road is one way or blocked
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index 69e13620c..dd6e6c7da 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -197,7 +197,9 @@ static CommandCost CheckTrackCombination(TileIndex tile, TrackBits to_build, uin
if ((flags & DC_NO_RAIL_OVERLAP) || HasSignals(tile)) {
/* If we are not allowed to overlap (flag is on for ai companies or we have
* signals on the tile), check that */
- if (future != TRACK_BIT_HORZ && future != TRACK_BIT_VERT) return_cmd_error(STR_ERROR_IMPOSSIBLE_TRACK_COMBINATION);
+ if (future != TRACK_BIT_HORZ && future != TRACK_BIT_VERT) {
+ return_cmd_error((flags & DC_NO_RAIL_OVERLAP) ? STR_ERROR_IMPOSSIBLE_TRACK_COMBINATION : STR_ERROR_MUST_REMOVE_SIGNALS_FIRST);
+ }
}
/* Normally, we may overlap and any combination is valid */
return CommandCost();