(svn r3907) Replace many bridge related direct map accesses with calls to shiny new functions and mark some strange constructs with XXX

This commit is contained in:
tron
2006-03-16 15:16:27 +00:00
parent d6134455a5
commit b8da06ddb1
13 changed files with 215 additions and 168 deletions

7
npf.c
View File

@@ -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;