summaryrefslogtreecommitdiff
path: root/src/track_func.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/track_func.h')
-rw-r--r--src/track_func.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/track_func.h b/src/track_func.h
index 8e2056265..a55d6d8f2 100644
--- a/src/track_func.h
+++ b/src/track_func.h
@@ -61,7 +61,7 @@ static inline bool IsValidTrackdirForRoadVehicle(Trackdir trackdir)
*/
static inline bool IsValidTrackdir(Trackdir trackdir)
{
- return (1 << trackdir & TRACKDIR_BIT_MASK) != TRACKDIR_BIT_NONE;
+ return trackdir != INVALID_TRACKDIR && ((1 << trackdir & TRACKDIR_BIT_MASK) != TRACKDIR_BIT_NONE);
}
/**