diff options
author | tron <tron@openttd.org> | 2006-03-16 15:16:27 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-03-16 15:16:27 +0000 |
commit | b8da06ddb11f234451864e0b454163ebb546e4cd (patch) | |
tree | 79a0e9518fd43cbe914bddcaebf4983201598bc8 /npf.c | |
parent | d6134455a5aaa7b247545886be573a555cdfc2be (diff) | |
download | openttd-b8da06ddb11f234451864e0b454163ebb546e4cd.tar.xz |
(svn r3907) Replace many bridge related direct map accesses with calls to shiny new functions and mark some strange constructs with XXX
Diffstat (limited to 'npf.c')
-rw-r--r-- | npf.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -2,6 +2,7 @@ #include "stdafx.h" #include "openttd.h" +#include "bridge_map.h" #include "debug.h" #include "functions.h" #include "npf.h" @@ -484,8 +485,10 @@ static bool VehicleMayEnterTile(Owner owner, TileIndex tile, DiagDirection enter /* if we were on a railway middle part, we are now at a railway bridge ending */ #endif if ((IsTunnel(tile) && GetTunnelTransportType(tile) == TRANSPORT_RAIL) || - (_m[tile].m5 & 0xC6) == 0x80 || /* railway bridge ending */ - ((_m[tile].m5 & 0xF8) == 0xE0 && GB(_m[tile].m5, 0, 1) != (enterdir & 0x1))) { /* railway under bridge */ + (IsBridge(tile) && ( + (IsBridgeRamp(tile) && GetBridgeTransportType(tile) == TRANSPORT_RAIL) || + (IsBridgeMiddle(tile) && IsTransportUnderBridge(tile) && GetTransportTypeUnderBridge(tile) == TRANSPORT_RAIL) + ))) { return IsTileOwner(tile, owner); } break; |