diff options
author | smatz <smatz@openttd.org> | 2009-08-08 20:53:36 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2009-08-08 20:53:36 +0000 |
commit | 13e23141b418214db51e1463bb3696a4e6d87129 (patch) | |
tree | 3b092f293fd5fdc1c1dd17120ba874d919824bf0 /src/saveload/subsidy_sl.cpp | |
parent | 8d809d5f4c21afbed4bbeb0388d42a9c5718a755 (diff) | |
download | openttd-13e23141b418214db51e1463bb3696a4e6d87129.tar.xz |
(svn r17124) -Codechange: store subsidies in a pool (instead of an array)
Diffstat (limited to 'src/saveload/subsidy_sl.cpp')
-rw-r--r-- | src/saveload/subsidy_sl.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/saveload/subsidy_sl.cpp b/src/saveload/subsidy_sl.cpp index 163a9ce8c..cf2985a09 100644 --- a/src/saveload/subsidy_sl.cpp +++ b/src/saveload/subsidy_sl.cpp @@ -24,7 +24,7 @@ void Save_SUBS() { Subsidy *s; FOR_ALL_SUBSIDIES(s) { - SlSetArrayIndex(s->Index()); + SlSetArrayIndex(s->index); SlObject(s, _subsidies_desc); } } @@ -33,7 +33,8 @@ void Load_SUBS() { int index; while ((index = SlIterateArray()) != -1) { - SlObject(&Subsidy::array[index], _subsidies_desc); + Subsidy *s = new (index) Subsidy(); + SlObject(s, _subsidies_desc); } } |