* Forcibly modify station ratings near a given tile. * Used when a crash hurts a company's station ratings nearby, or when local authority actions affect nearby ratings. * @param tile The center of the ratings change area. * @param owner The station owner whose stations are affected. * @param amount The amount to change the rating. * @param radius The radius to search for stations, from the o
| 4386 | * @param radius The radius to search for stations, from the origin tile. |
| 4387 | */ |
| 4388 | void ModifyStationRatingAround(TileIndex tile, Owner owner, int amount, uint radius) |
| 4389 | { |
| 4390 | ForAllStationsRadius(tile, radius, [&](Station *st) { |
| 4391 | if (st->owner == owner && DistanceManhattan(tile, st->xy) <= radius) { |
| 4392 | for (GoodsEntry &ge : st->goods) { |
| 4393 | if (ge.status.Any()) { |
| 4394 | ge.rating = ClampTo<uint8_t>(ge.rating + amount); |
| 4395 | } |
| 4396 | } |
| 4397 | } |
| 4398 | }); |
| 4399 | } |
| 4400 | |
| 4401 | static uint UpdateStationWaiting(Station *st, CargoType cargo, uint amount, Source source) |
| 4402 | { |
no test coverage detected