* Determine the effective #WaterClass for a ship travelling on a tile. * @param tile Tile of interest * @return the waterclass to be used by the ship. */
| 51 | * @return the waterclass to be used by the ship. |
| 52 | */ |
| 53 | WaterClass GetEffectiveWaterClass(TileIndex tile) |
| 54 | { |
| 55 | if (HasTileWaterClass(tile)) return GetWaterClass(tile); |
| 56 | if (IsTileType(tile, MP_TUNNELBRIDGE)) { |
| 57 | assert(GetTunnelBridgeTransportType(tile) == TRANSPORT_WATER); |
| 58 | return WaterClass::Canal; |
| 59 | } |
| 60 | if (IsTileType(tile, MP_RAILWAY)) { |
| 61 | assert(GetRailGroundType(tile) == RailGroundType::HalfTileWater); |
| 62 | return WaterClass::Sea; |
| 63 | } |
| 64 | NOT_REACHED(); |
| 65 | } |
| 66 | |
| 67 | static const uint16_t _ship_sprites[] = {0x0E5D, 0x0E55, 0x0E65, 0x0E6D}; |
| 68 |
no test coverage detected