Loading

Revision differences

Old revision #pkap1qfo6New revision #ps2m2br1i
12                 MarkCanalsAndRiversAroundDirty(tile);  12                 MarkCanalsAndRiversAroundDirty(tile);  
13             }  13             }  
14   14   
15@@ -1240,7 +1242,17 @@  15@@ -1233,6 +1235,7 @@
   16 
   17 static TrackStatus GetTileTrackStatus_Water(TileIndex tile, TransportType mode, uint sub_mode, DiagDirection side)
   18 {
   19+    static const byte clear_tracks[] = {63, 32, 4, 0, 16, 0, 0, 8, 8, 0, 0, 16, 0, 4, 32, 63};
   20     static const byte coast_tracks[] = {0, 32, 4, 0, 16, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0};
   21 
   22     TrackBits ts;
   23@@ -1240,7 +1243,7 @@
16     if (mode != TRANSPORT_WATER) return 0;  24     if (mode != TRANSPORT_WATER) return 0;  
17   25   
18     switch (GetWaterTileType(tile)) {  26     switch (GetWaterTileType(tile)) {  
19-        case WATER_TILE_CLEAR: ts = IsTileFlat(tile) ? TRACK_BIT_ALL : TRACK_BIT_NONE; break;  27-        case WATER_TILE_CLEAR: ts = IsTileFlat(tile) ? TRACK_BIT_ALL : TRACK_BIT_NONE; break;  
20+        case WATER_TILE_CLEAR:  20+        case WATER_TILE_CLEAR: ts = IsTileFlat(tile) ? TRACK_BIT_ALL : (TrackBits)clear_tracks[GetTileSlope(tile) & 0xF]; break;
21+            if (IsTileFlat(tile)) ts = TRACK_BIT_ALL;    
22+            if (GetTileSlope(tile) == SLOPE_W) ts = TRACK_BIT_RIGHT;    
23+            if (GetTileSlope(tile) == SLOPE_S) ts = TRACK_BIT_UPPER;    
24+            if (GetTileSlope(tile) == SLOPE_E) ts = TRACK_BIT_LEFT;    
25+            if (GetTileSlope(tile) == SLOPE_N) ts = TRACK_BIT_LOWER;    
26+            if (GetTileSlope(tile) == SLOPE_NWS) ts = TRACK_BIT_LEFT;    
27+            if (GetTileSlope(tile) == SLOPE_WSE) ts = TRACK_BIT_LOWER;    
28+            if (GetTileSlope(tile) == SLOPE_SEN) ts = TRACK_BIT_RIGHT;    
29+            if (GetTileSlope(tile) == SLOPE_ENW) ts = TRACK_BIT_UPPER;    
30+            break;    
31         case WATER_TILE_COAST: ts = (TrackBits)coast_tracks[GetTileSlope(tile) & 0xF]; break;  29         case WATER_TILE_COAST: ts = (TrackBits)coast_tracks[GetTileSlope(tile) & 0xF]; break;  
32         case WATER_TILE_LOCK:  ts = DiagDirToDiagTrackBits(GetLockDirection(tile)); break;  30         case WATER_TILE_LOCK:  ts = DiagDirToDiagTrackBits(GetLockDirection(tile)); break;  
33         case WATER_TILE_DEPOT: ts = AxisToTrackBits(GetShipDepotAxis(tile)); break; 31         case WATER_TILE_DEPOT: ts = AxisToTrackBits(GetShipDepotAxis(tile)); break;