* Mark the supplied tile as a docking tile if it is suitable for docking. * Tiles surrounding the tile are tested to be docks with correct orientation. * @param t Tile to test. */
| 192 | * @param t Tile to test. |
| 193 | */ |
| 194 | void CheckForDockingTile(TileIndex t) |
| 195 | { |
| 196 | for (DiagDirection d = DIAGDIR_BEGIN; d != DIAGDIR_END; d++) { |
| 197 | TileIndex tile = t + TileOffsByDiagDir(d); |
| 198 | if (!IsValidTile(tile)) continue; |
| 199 | |
| 200 | if (IsDockTile(tile) && IsDockWaterPart(tile)) { |
| 201 | Station::GetByTile(tile)->docking_station.Add(t); |
| 202 | SetDockingTile(t, true); |
| 203 | } |
| 204 | if (IsTileType(tile, MP_INDUSTRY)) { |
| 205 | Station *st = Industry::GetByTile(tile)->neutral_station; |
| 206 | if (st != nullptr) { |
| 207 | st->docking_station.Add(t); |
| 208 | SetDockingTile(t, true); |
| 209 | } |
| 210 | } |
| 211 | if (IsTileType(tile, MP_STATION) && IsOilRig(tile)) { |
| 212 | Station::GetByTile(tile)->docking_station.Add(t); |
| 213 | SetDockingTile(t, true); |
| 214 | } |
| 215 | } |
| 216 | } |
| 217 | |
| 218 | void MakeWaterKeepingClass(TileIndex tile, Owner o) |
| 219 | { |
no test coverage detected