* Get the acceptance of cargoes around the tile in 1/8. * @param center_tile Center of the search area * @param w X extent of area * @param h Y extent of area * @param rad Search radius in addition to given area * @param always_accepted bitmask of cargo accepted by houses and headquarters; can be nullptr * @param ind Industry associated with neutral station (e.g. oil rig) or nullptr */
| 569 | * @param ind Industry associated with neutral station (e.g. oil rig) or nullptr |
| 570 | */ |
| 571 | CargoArray GetAcceptanceAroundTiles(TileIndex center_tile, int w, int h, int rad, CargoTypes *always_accepted) |
| 572 | { |
| 573 | CargoArray acceptance{}; |
| 574 | if (always_accepted != nullptr) *always_accepted = 0; |
| 575 | |
| 576 | TileArea ta = TileArea(center_tile, w, h).Expand(rad); |
| 577 | |
| 578 | for (TileIndex tile : ta) { |
| 579 | /* Ignore industry if it has a neutral station. */ |
| 580 | if (!_settings_game.station.serve_neutral_industries && IsTileType(tile, MP_INDUSTRY) && Industry::GetByTile(tile)->neutral_station != nullptr) continue; |
| 581 | |
| 582 | AddAcceptedCargo(tile, acceptance, always_accepted); |
| 583 | } |
| 584 | |
| 585 | return acceptance; |
| 586 | } |
| 587 | |
| 588 | /** |
| 589 | * Get the acceptance of cargoes around the station in. |
no test coverage detected