diff options
author | smatz <smatz@openttd.org> | 2009-05-17 16:28:29 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2009-05-17 16:28:29 +0000 |
commit | 570af0ce449b6c94427233d7eae07c40bb789197 (patch) | |
tree | 81450baf6a65200503c2871c31e586ac5214d054 /src/saveload/industry_sl.cpp | |
parent | 83dc6ef6e6064441c9a5ebc22061de313147821a (diff) | |
download | openttd-570af0ce449b6c94427233d7eae07c40bb789197.tar.xz |
(svn r16338) -Codechange: split loading of references to two phases
In the first phase, indexes are stored. In the second phase, indexes are checked for validity and converted to pointers
Diffstat (limited to 'src/saveload/industry_sl.cpp')
-rw-r--r-- | src/saveload/industry_sl.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/saveload/industry_sl.cpp b/src/saveload/industry_sl.cpp index 1e4a77ee4..25a3ca4ab 100644 --- a/src/saveload/industry_sl.cpp +++ b/src/saveload/industry_sl.cpp @@ -148,8 +148,17 @@ static void Load_TIDS() } } +static void Ptrs_INDY() +{ + Industry *i; + + FOR_ALL_INDUSTRIES(i) { + SlObject(i, _industry_desc); + } +} + extern const ChunkHandler _industry_chunk_handlers[] = { - { 'INDY', Save_INDY, Load_INDY, CH_ARRAY}, - { 'IIDS', Save_IIDS, Load_IIDS, CH_ARRAY}, - { 'TIDS', Save_TIDS, Load_TIDS, CH_ARRAY | CH_LAST}, + { 'INDY', Save_INDY, Load_INDY, Ptrs_INDY, CH_ARRAY}, + { 'IIDS', Save_IIDS, Load_IIDS, NULL, CH_ARRAY}, + { 'TIDS', Save_TIDS, Load_TIDS, NULL, CH_ARRAY | CH_LAST}, }; |