* Add all new airports to the airport array. Airport properties can be set at any * time in the GRF file, so we can only add a airport spec to the airport array * after the file has finished loading. */
| 1186 | * after the file has finished loading. |
| 1187 | */ |
| 1188 | static void FinaliseAirportsArray() |
| 1189 | { |
| 1190 | for (auto &file : _grf_files) { |
| 1191 | for (auto &as : file.airportspec) { |
| 1192 | if (as != nullptr && as->enabled) { |
| 1193 | _airport_mngr.SetEntitySpec(std::move(*as)); |
| 1194 | } |
| 1195 | } |
| 1196 | |
| 1197 | for (auto &ats : file.airtspec) { |
| 1198 | if (ats != nullptr && ats->enabled) { |
| 1199 | _airporttile_mngr.SetEntitySpec(std::move(*ats)); |
| 1200 | } |
| 1201 | } |
| 1202 | |
| 1203 | /* Won't be used again */ |
| 1204 | file.airportspec.clear(); |
| 1205 | file.airportspec.shrink_to_fit(); |
| 1206 | file.airtspec.clear(); |
| 1207 | file.airtspec.shrink_to_fit(); |
| 1208 | } |
| 1209 | } |
| 1210 | |
| 1211 | /** Helper class to invoke a GrfActionHandler. */ |
| 1212 | struct InvokeGrfActionHandler { |
no test coverage detected