summaryrefslogtreecommitdiff
path: root/src/rail_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rail_cmd.cpp')
-rw-r--r--src/rail_cmd.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index 19c044e31..7bab2a254 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -155,7 +155,9 @@ static const byte _track_sloped_sprites[14] = {
static bool EnsureNoTrainOnTrack(TileIndex tile, Track track)
{
TrackBits rail_bits = TrackToTrackBits(track);
- return EnsureNoTrainOnTrackBits(tile, rail_bits);
+ CommandCost ret = EnsureNoTrainOnTrackBits(tile, rail_bits);
+ ret.SetGlobalErrorMessage();
+ return ret.Succeeded();
}
/** Check that the new track bits may be built.