diff options
author | smatz <smatz@openttd.org> | 2009-07-01 18:45:05 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2009-07-01 18:45:05 +0000 |
commit | 76a50ce94dc7c78d76c309d8a639591fed2a2da8 (patch) | |
tree | 342be7030b9760781f886bca89cbe01863985008 /src/saveload/subsidy_sl.cpp | |
parent | aaeb53066dff98cac2d66d1f02f545d14c9f650c (diff) | |
download | openttd-76a50ce94dc7c78d76c309d8a639591fed2a2da8.tar.xz |
(svn r16714) -Codechange: use pool-like accessors for Subsidy
Diffstat (limited to 'src/saveload/subsidy_sl.cpp')
-rw-r--r-- | src/saveload/subsidy_sl.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/saveload/subsidy_sl.cpp b/src/saveload/subsidy_sl.cpp index 7e59a80e3..f7b6a8f12 100644 --- a/src/saveload/subsidy_sl.cpp +++ b/src/saveload/subsidy_sl.cpp @@ -3,7 +3,7 @@ /** @file subsidy_sl.cpp Code handling saving and loading of subsidies */ #include "../stdafx.h" -#include "../subsidy_type.h" +#include "../subsidy_base.h" #include "saveload.h" @@ -21,7 +21,7 @@ void Save_SUBS() { Subsidy *s; FOR_ALL_SUBSIDIES(s) { - SlSetArrayIndex(s - _subsidies); + SlSetArrayIndex(s->Index()); SlObject(s, _subsidies_desc); } } @@ -29,8 +29,9 @@ void Save_SUBS() void Load_SUBS() { int index; - while ((index = SlIterateArray()) != -1) - SlObject(&_subsidies[index], _subsidies_desc); + while ((index = SlIterateArray()) != -1) { + SlObject(&Subsidy::array[index], _subsidies_desc); + } } extern const ChunkHandler _subsidy_chunk_handlers[] = { |