Loading

Revision differences

Old revision #pol6ejtzlNew revision #pktd4qic5
17    Track track = TrackBitsToTrack(TrackStatusToTrackBits(GetTileTrackStatus(tile, TRANSPORT_WATER, 0)));  17    Track track = TrackBitsToTrack(TrackStatusToTrackBits(GetTileTrackStatus(tile, TRANSPORT_WATER, 0)));  
18    Trackdir trackdir = TrackToTrackdir(track);  18    Trackdir trackdir = TrackToTrackdir(track);  
19  19  
20    DiagDirection dir_a = TrackdirToExitdir(trackdir);    
21    DiagDirection dir_b = TrackdirToExitdir(ReverseTrackdir(trackdir));    
22    
23    TileIndex tile_a = AddTileIndexDiffCWrap(tile, TileIndexDiffCByDiagDir(dir_a));    
24    TileIndex tile_b = AddTileIndexDiffCWrap(tile, TileIndexDiffCByDiagDir(dir_b));    
25    
26    Corner corner = GetHighestSlopeCorner(slope);  20    Corner corner = GetHighestSlopeCorner(slope);  
27    static const Direction corner_to_direction[] = { DIR_W, DIR_S, DIR_E, DIR_N };  21    static const Direction corner_to_direction[] = { DIR_W, DIR_S, DIR_E, DIR_N };  
28  22  
29    /* Test adjacent tiles are valid */  23    /* Test adjacent tiles are valid */  
30    TileIndex tile_a = AddTileIndexDiffCWrap(tile, TileIndexDiffCByDiagDir(dir_a));  30    TileIndex tile_a = AddTileIndexDiffCWrap(tile, TileIndexDiffCByDiagDir(TrackdirToExitdir(trackdir)));
31    if (!IsValidTile(tile_a)) return false;  25    if (!IsValidTile(tile_a)) return false;  
32    TileIndex tile_b = AddTileIndexDiffCWrap(tile, TileIndexDiffCByDiagDir(dir_b));  32    TileIndex tile_b = AddTileIndexDiffCWrap(tile, TileIndexDiffCByDiagDir(TrackdirToExitdir(ReverseTrackdir(trackdir))));
33    if (!IsValidTile(tile_b)) return false;  27    if (!IsValidTile(tile_b)) return false;  
34    TileIndex tile_o = AddTileIndexDiffCWrap(tile, TileIndexDiffCByDir(corner_to_direction[OppositeCorner(corner)]));  28    TileIndex tile_o = AddTileIndexDiffCWrap(tile, TileIndexDiffCByDir(corner_to_direction[OppositeCorner(corner)]));  
35    if (!IsValidTile(tile_o)) return false;  29    if (!IsValidTile(tile_o)) return false;