| 68 | } |
| 69 | |
| 70 | void Load() const override |
| 71 | { |
| 72 | const std::vector<SaveLoad> slt = SlCompatTableHeader(_engine_desc, _engine_sl_compat); |
| 73 | |
| 74 | /* As engine data is loaded before engines are initialized we need to load |
| 75 | * this information into a temporary array. This is then copied into the |
| 76 | * engine pool after processing NewGRFs by CopyTempEngineData(). */ |
| 77 | int index; |
| 78 | while ((index = SlIterateArray()) != -1) { |
| 79 | Engine *e = GetTempDataEngine(static_cast<EngineID>(index)); |
| 80 | SlObject(e, slt); |
| 81 | |
| 82 | if (IsSavegameVersionBefore(SLV_179)) { |
| 83 | /* preview_company_rank was replaced with preview_company and preview_asked. |
| 84 | * Just cancel any previews. */ |
| 85 | e->flags.Reset(EngineFlag{2}); // ENGINE_OFFER_WINDOW_OPEN |
| 86 | e->preview_company = CompanyID::Invalid(); |
| 87 | e->preview_asked.Set(); |
| 88 | } |
| 89 | } |
| 90 | } |
| 91 | }; |
| 92 | |
| 93 | /** |
nothing calls this directly
no test coverage detected