From 4b74fa19230897c9e9b20e6bcba2b16c748cb09f Mon Sep 17 00:00:00 2001 From: tron Date: Sun, 19 Mar 2006 13:48:08 +0000 Subject: (svn r3981) More work for the rail accessing functions and enums --- train_cmd.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'train_cmd.c') diff --git a/train_cmd.c b/train_cmd.c index 189947c99..13124d92b 100644 --- a/train_cmd.c +++ b/train_cmd.c @@ -1746,12 +1746,13 @@ typedef struct TrainFindDepotData { static bool NtpCallbFindDepot(TileIndex tile, TrainFindDepotData *tfdd, int track, uint length) { - if (IsTileType(tile, MP_RAILWAY) && IsTileOwner(tile, tfdd->owner)) { - if ((_m[tile].m5 & 0xFC) == 0xC0) { - tfdd->best_length = length; - tfdd->tile = tile; - return true; - } + if (IsTileType(tile, MP_RAILWAY) && + IsTileOwner(tile, tfdd->owner) && + GetRailTileType(tile) == RAIL_TYPE_DEPOT_WAYPOINT && + GetRailTileSubtype(tile) == RAIL_SUBTYPE_DEPOT) { + tfdd->best_length = length; + tfdd->tile = tile; + return true; } return false; @@ -2654,7 +2655,7 @@ static void TrainMovedChangeSignals(TileIndex tile, DiagDirection dir) { if (IsTileType(tile, MP_RAILWAY) && GetRailTileType(tile) == RAIL_TYPE_SIGNALS) { - uint i = FindFirstBit2x64((_m[tile].m5 + (_m[tile].m5 << 8)) & _reachable_tracks[dir]); + uint i = FindFirstBit2x64(GetTrackBits(tile) * 0x101 & _reachable_tracks[dir]); UpdateSignalsOnSegment(tile, _otherside_signal_directions[i]); } } -- cgit v1.2.3-54-g00ecf