* Calculates amount of active stations in the range of town (HZB_TOWN_EDGE). * @param t The town to calculate stations for * @returns Amount of active stations */
| 3817 | * @returns Amount of active stations |
| 3818 | */ |
| 3819 | static int CountActiveStations(Town *t) |
| 3820 | { |
| 3821 | int n = 0; |
| 3822 | ForAllStationsNearTown(t, [&](const Station * st) { |
| 3823 | if (st->time_since_load <= 20 || st->time_since_unload <= 20) { |
| 3824 | n++; |
| 3825 | } |
| 3826 | }); |
| 3827 | return n; |
| 3828 | } |
| 3829 | |
| 3830 | /** |
| 3831 | * Calculates town growth rate in normal conditions (custom growth rate not set). |
no test coverage detected