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 | 6e988259a42191d8c79c46780981440ed91b5186 (patch) | |
tree | 79a0e9518fd43cbe914bddcaebf4983201598bc8 /ai/default | |
parent | b2e804561387d4f8714f53c9e61b0b9e396f60e0 (diff) | |
download | openttd-6e988259a42191d8c79c46780981440ed91b5186.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 'ai/default')
-rw-r--r-- | ai/default/default.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ai/default/default.c b/ai/default/default.c index c5d463e45..5d481b7e1 100644 --- a/ai/default/default.c +++ b/ai/default/default.c @@ -2157,8 +2157,7 @@ static bool AiRemoveTileAndGoForward(Player *p) return true; } - if (!(_m[tile].m5 & 0x40)) { - + if (IsBridgeRamp(tile)) { // Check if the bridge points in the right direction. // This is not really needed the first place AiRemoveTileAndGoForward is called. if (DiagDirToAxis(GetBridgeRampDirection(tile)) != (p->ai.cur_dir_a & 1U)) return false; @@ -3669,8 +3668,12 @@ pos_3: CMD_REMOVE_ROAD); } } else if (IsTileType(tile, MP_TUNNELBRIDGE)) { - if (!IsTileOwner(tile, _current_player) || (_m[tile].m5 & 0xC6) != 0x80) + if (!IsTileOwner(tile, _current_player) || + !IsBridge(tile) || + !IsBridgeRamp(tile) || + GetBridgeTransportType(tile) != TRANSPORT_RAIL) { return; + } m5 = 0; |