summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2013-03-11 18:01:23 +0000
committerfrosch <frosch@openttd.org>2013-03-11 18:01:23 +0000
commitaa2ff3d552beba30444312bec437cdd76e1bdb27 (patch)
treeadd1a6a76f5b31b41ff53423ac393878eb612280 /src
parentf800c826a82268ca0223758c7d3d45f8b0d59771 (diff)
downloadopenttd-aa2ff3d552beba30444312bec437cdd76e1bdb27.tar.xz
(svn r25082) -Codechange [FS#5501]: Simplify some code. (adf88)
Diffstat (limited to 'src')
-rw-r--r--src/rail_cmd.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index 56b87b955..042108d68 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -1022,15 +1022,8 @@ CommandCost CmdBuildSingleSignal(TileIndex tile, DoCommandFlag flags, uint32 p1,
CommandCost ret = CheckTileOwnership(tile);
if (ret.Failed()) return ret;
- {
- /* See if this is a valid track combination for signals, (ie, no overlap) */
- TrackBits trackbits = GetTrackBits(tile);
- if (KillFirstBit(trackbits) != TRACK_BIT_NONE && // More than one track present
- trackbits != TRACK_BIT_HORZ &&
- trackbits != TRACK_BIT_VERT) {
- return_cmd_error(STR_ERROR_NO_SUITABLE_RAILROAD_TRACK);
- }
- }
+ /* See if this is a valid track combination for signals (no overlap) */
+ if (TracksOverlap(GetTrackBits(tile))) return_cmd_error(STR_ERROR_NO_SUITABLE_RAILROAD_TRACK);
/* In case we don't want to change an existing signal, return without error. */
if (HasBit(p1, 17) && HasSignalOnTrack(tile, track)) return CommandCost();