From 9af2e38d44abfe119b0c3e3b5647c6309cc979e2 Mon Sep 17 00:00:00 2001
From: smatz <smatz@openttd.org>
Date: Mon, 18 May 2009 01:35:15 +0000
Subject: [PATCH] (svn r16350) -Codechange: make some 'rail track is present'
 checks more 'secure'

---
 src/elrail.cpp   | 2 +-
 src/rail_cmd.cpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/elrail.cpp b/src/elrail.cpp
index 432ae60ba3..81ee510e48 100644
--- a/src/elrail.cpp
+++ b/src/elrail.cpp
@@ -116,7 +116,7 @@ static TrackBits GetRailTrackBitsUniversal(TileIndex t, byte *override)
  */
 static TrackBits MaskWireBits(TileIndex t, TrackBits tracks)
 {
-	if (!IsPlainRail(t)) return tracks;
+	if (!IsPlainRailTile(t)) return tracks;
 
 	TrackdirBits neighbour_tdb = TRACKDIR_BIT_NONE;
 	for (DiagDirection d = DIAGDIR_BEGIN; d < DIAGDIR_END; d++) {
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index 428779a321..eb0c137a86 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -827,7 +827,7 @@ CommandCost CmdBuildSingleSignal(TileIndex tile, DoCommandFlag flags, uint32 p1,
 
 	/* You can only build signals on plain rail tiles, and the selected track must exist */
 	if (!ValParamTrackOrientation(track) || !IsPlainRailTile(tile) ||
-			!EnsureNoTrainOnTrack(tile, track) || !HasTrack(tile, track)) {
+			!HasTrack(tile, track) || !EnsureNoTrainOnTrack(tile, track)) {
 		return CMD_ERROR;
 	}