diff options
author | tron <tron@openttd.org> | 2006-02-06 09:18:04 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-02-06 09:18:04 +0000 |
commit | 087fe86ed28fb6ac5885cac7f64d34ccd5a9c140 (patch) | |
tree | 3a4002304d8204d11c37ba706d6ffbd2e5dfac1b /tunnelbridge_cmd.c | |
parent | 75a70e1def8c677d2340a49e9f12e4c2a5d65aee (diff) | |
download | openttd-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 'tunnelbridge_cmd.c')
-rw-r--r-- | tunnelbridge_cmd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tunnelbridge_cmd.c b/tunnelbridge_cmd.c index bcec4f093..8178d162a 100644 --- a/tunnelbridge_cmd.c +++ b/tunnelbridge_cmd.c @@ -1466,12 +1466,12 @@ static const byte _tunnel_fractcoord_7[4] = {0x52, 0x85, 0x96, 0x49}; static uint32 VehicleEnter_TunnelBridge(Vehicle *v, TileIndex tile, int x, int y) { - int z; int dir, vdir; - byte fc; if (GB(_m[tile].m5, 4, 4) == 0) { - z = GetSlopeZ(x, y) - v->z_pos; + int z = GetSlopeZ(x, y) - v->z_pos; + byte fc; + if (myabs(z) > 2) return 8; if (v->type == VEH_Train) { |