summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rail.c4
-rw-r--r--rail.h3
2 files changed, 1 insertions, 6 deletions
diff --git a/rail.c b/rail.c
index f89fcaa3a..5b6650667 100644
--- a/rail.c
+++ b/rail.c
@@ -101,10 +101,6 @@ const Trackdir _dir_to_diag_trackdir[] = {
TRACKDIR_X_NE, TRACKDIR_Y_SE, TRACKDIR_X_SW, TRACKDIR_Y_NW,
};
-const Trackdir _reverse_trackdir[] = {
- TRACKDIR_X_SW, TRACKDIR_Y_NW, TRACKDIR_UPPER_W, TRACKDIR_LOWER_W, TRACKDIR_LEFT_N, TRACKDIR_RIGHT_N, INVALID_TRACKDIR, INVALID_TRACKDIR,
- TRACKDIR_X_NE, TRACKDIR_Y_SE, TRACKDIR_UPPER_E, TRACKDIR_LOWER_E, TRACKDIR_LEFT_S, TRACKDIR_RIGHT_S
-};
RailType GetTileRailType(TileIndex tile, Trackdir trackdir)
{
diff --git a/rail.h b/rail.h
index 8bb0be416..fa95fdd27 100644
--- a/rail.h
+++ b/rail.h
@@ -238,8 +238,7 @@ static inline bool HasTrack(TileIndex tile, Track track)
* Maps a trackdir to the reverse trackdir.
*/
static inline Trackdir ReverseTrackdir(Trackdir trackdir) {
- extern const Trackdir _reverse_trackdir[TRACKDIR_END];
- return _reverse_trackdir[trackdir];
+ return (Trackdir)(trackdir ^ 8);
}
/**