diff options
Diffstat (limited to 'src/saveload/subsidy_sl.cpp')
-rw-r--r-- | src/saveload/subsidy_sl.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/saveload/subsidy_sl.cpp b/src/saveload/subsidy_sl.cpp index 9ed65a04e..0a9c25ebd 100644 --- a/src/saveload/subsidy_sl.cpp +++ b/src/saveload/subsidy_sl.cpp @@ -8,9 +8,11 @@ /** @file subsidy_sl.cpp Code handling saving and loading of subsidies */ #include "../stdafx.h" -#include "../subsidy_base.h" #include "saveload.h" +#include "compat/subsidy_sl_compat.h" + +#include "../subsidy_base.h" #include "../safeguards.h" @@ -29,6 +31,8 @@ static const SaveLoad _subsidies_desc[] = { static void Save_SUBS() { + SlTableHeader(_subsidies_desc); + for (Subsidy *s : Subsidy::Iterate()) { SlSetArrayIndex(s->index); SlObject(s, _subsidies_desc); @@ -37,15 +41,17 @@ static void Save_SUBS() static void Load_SUBS() { + const std::vector<SaveLoad> slt = SlCompatTableHeader(_subsidies_desc, _subsidies_sl_compat); + int index; while ((index = SlIterateArray()) != -1) { Subsidy *s = new (index) Subsidy(); - SlObject(s, _subsidies_desc); + SlObject(s, slt); } } static const ChunkHandler subsidy_chunk_handlers[] = { - { 'SUBS', Save_SUBS, Load_SUBS, nullptr, nullptr, CH_ARRAY }, + { 'SUBS', Save_SUBS, Load_SUBS, nullptr, nullptr, CH_TABLE }, }; extern const ChunkHandlerTable _subsidy_chunk_handlers(subsidy_chunk_handlers); |