summaryrefslogtreecommitdiff
path: root/rail.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-02-06 09:18:04 +0000
committertron <tron@openttd.org>2006-02-06 09:18:04 +0000
commit087fe86ed28fb6ac5885cac7f64d34ccd5a9c140 (patch)
tree3a4002304d8204d11c37ba706d6ffbd2e5dfac1b /rail.h
parent75a70e1def8c677d2340a49e9f12e4c2a5d65aee (diff)
downloadopenttd-087fe86ed28fb6ac5885cac7f64d34ccd5a9c140.tar.xz
(svn r3564) Several smaller changes:
- Don't treat non-booleans as booleans - Reduce variable scope - Bracing - Use DeMorgan's law to make conditionals easier to read - if cascade -> switch - Replace some magic numbers by symbolic names - Avoid assignments within other statements
Diffstat (limited to 'rail.h')
-rw-r--r--rail.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/rail.h b/rail.h
index c6700eb0e..9938bdb7f 100644
--- a/rail.h
+++ b/rail.h
@@ -635,9 +635,9 @@ static inline bool TracksOverlap(TrackBits bits)
/* We know that there are at least two tracks present. When there are more
* than 2 tracks, they will surely overlap. When there are two, they will
* always overlap unless they are lower & upper or right & left. */
- if ((bits == (TRACK_BIT_UPPER|TRACK_BIT_LOWER)) || (bits == (TRACK_BIT_LEFT | TRACK_BIT_RIGHT)))
- return false;
- return true;
+ return
+ bits != (TRACK_BIT_UPPER | TRACK_BIT_LOWER) &&
+ bits != (TRACK_BIT_LEFT | TRACK_BIT_RIGHT);
}
void DrawTrainDepotSprite(int x, int y, int image, RailType railtype);