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/company_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/company_sl.cpp')
-rw-r--r-- | src/saveload/company_sl.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/saveload/company_sl.cpp b/src/saveload/company_sl.cpp index 0e242422f..8c44fee0c 100644 --- a/src/saveload/company_sl.cpp +++ b/src/saveload/company_sl.cpp @@ -277,6 +277,15 @@ static void Load_PLYR() } } +static void Ptrs_PLYR() +{ + Company *c; + FOR_ALL_COMPANIES(c) { + SlObject(c, _company_desc); + } +} + + extern const ChunkHandler _company_chunk_handlers[] = { - { 'PLYR', Save_PLYR, Load_PLYR, CH_ARRAY | CH_LAST}, + { 'PLYR', Save_PLYR, Load_PLYR, Ptrs_PLYR, CH_ARRAY | CH_LAST}, }; |