(svn r3981) More work for the rail accessing functions and enums

This commit is contained in:
tron
2006-03-19 13:48:08 +00:00
parent 52e5d9f328
commit 4b74fa1923
8 changed files with 51 additions and 50 deletions

View File

@@ -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]);
}
}