| 4682 | } |
| 4683 | |
| 4684 | void UpdateStationDockingTiles(Station *st) |
| 4685 | { |
| 4686 | st->docking_station.Clear(); |
| 4687 | |
| 4688 | /* For neutral stations, start with the industry area instead of dock area */ |
| 4689 | const TileArea *area = st->industry != nullptr ? &st->industry->location : &st->ship_station; |
| 4690 | |
| 4691 | if (area->tile == INVALID_TILE) return; |
| 4692 | |
| 4693 | int x = TileX(area->tile); |
| 4694 | int y = TileY(area->tile); |
| 4695 | |
| 4696 | /* Expand the area by a tile on each side while |
| 4697 | * making sure that we remain inside the map. */ |
| 4698 | int x2 = std::min<int>(x + area->w + 1, Map::SizeX()); |
| 4699 | int x1 = std::max<int>(x - 1, 0); |
| 4700 | |
| 4701 | int y2 = std::min<int>(y + area->h + 1, Map::SizeY()); |
| 4702 | int y1 = std::max<int>(y - 1, 0); |
| 4703 | |
| 4704 | TileArea ta(TileXY(x1, y1), TileXY(x2 - 1, y2 - 1)); |
| 4705 | for (TileIndex tile : ta) { |
| 4706 | if (IsValidTile(tile) && IsPossibleDockingTile(tile)) CheckForDockingTile(tile); |
| 4707 | } |
| 4708 | } |
| 4709 | |
| 4710 | void BuildOilRig(TileIndex tile) |
| 4711 | { |
no test coverage detected