forked from mirror/OpenTTD
Fix: Protect against a few out of bounds or uninitialised usage errors
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user