* Add all new objects to the object array. Object properties can be set at any * time in the GRF file, so we can only add an object spec to the object array * after the file has finished loading. */
| 1164 | * after the file has finished loading. |
| 1165 | */ |
| 1166 | static void FinaliseObjectsArray() |
| 1167 | { |
| 1168 | for (auto &file : _grf_files) { |
| 1169 | for (auto &objectspec : file.objectspec) { |
| 1170 | if (objectspec != nullptr && objectspec->grf_prop.HasGrfFile() && objectspec->IsEnabled()) { |
| 1171 | _object_mngr.SetEntitySpec(std::move(*objectspec)); |
| 1172 | } |
| 1173 | } |
| 1174 | |
| 1175 | /* Won't be used again */ |
| 1176 | file.objectspec.clear(); |
| 1177 | file.objectspec.shrink_to_fit(); |
| 1178 | } |
| 1179 | |
| 1180 | ObjectSpec::BindToClasses(); |
| 1181 | } |
| 1182 | |
| 1183 | /** |
| 1184 | * Add all new airports to the airport array. Airport properties can be set at any |
no test coverage detected