summaryrefslogtreecommitdiff
path: root/src/saveload/autoreplace_sl.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-05-17 16:28:29 +0000
committersmatz <smatz@openttd.org>2009-05-17 16:28:29 +0000
commit570af0ce449b6c94427233d7eae07c40bb789197 (patch)
tree81450baf6a65200503c2871c31e586ac5214d054 /src/saveload/autoreplace_sl.cpp
parent83dc6ef6e6064441c9a5ebc22061de313147821a (diff)
downloadopenttd-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/autoreplace_sl.cpp')
-rw-r--r--src/saveload/autoreplace_sl.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/saveload/autoreplace_sl.cpp b/src/saveload/autoreplace_sl.cpp
index 7ed3a2051..377fec902 100644
--- a/src/saveload/autoreplace_sl.cpp
+++ b/src/saveload/autoreplace_sl.cpp
@@ -45,6 +45,15 @@ static void Load_ERNW()
}
}
+static void Ptrs_ERNW()
+{
+ EngineRenew *er;
+
+ FOR_ALL_ENGINE_RENEWS(er) {
+ SlObject(er, _engine_renew_desc);
+ }
+}
+
extern const ChunkHandler _autoreplace_chunk_handlers[] = {
- { 'ERNW', Save_ERNW, Load_ERNW, CH_ARRAY | CH_LAST},
+ { 'ERNW', Save_ERNW, Load_ERNW, Ptrs_ERNW, CH_ARRAY | CH_LAST},
};