(svn r16714) -Codechange: use pool-like accessors for Subsidy
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
#include "../town.h"
|
||||
#include "../economy_base.h"
|
||||
#include "../animated_tile_func.h"
|
||||
#include "../subsidy_type.h"
|
||||
#include "../subsidy_base.h"
|
||||
|
||||
#include "table/strings.h"
|
||||
|
||||
|
@@ -12,7 +12,7 @@
|
||||
#include "../train.h"
|
||||
#include "../signs_base.h"
|
||||
#include "../station_base.h"
|
||||
#include "../subsidy_type.h"
|
||||
#include "../subsidy_base.h"
|
||||
#include "../debug.h"
|
||||
#include "../depot_base.h"
|
||||
#include "../newgrf_config.h"
|
||||
@@ -1475,7 +1475,7 @@ static const OldChunks subsidy_chunk[] = {
|
||||
|
||||
static bool LoadOldSubsidy(LoadgameState *ls, int num)
|
||||
{
|
||||
return LoadChunk(ls, &_subsidies[num], subsidy_chunk);
|
||||
return LoadChunk(ls, &Subsidy::array[num], subsidy_chunk);
|
||||
}
|
||||
|
||||
static const OldChunks game_difficulty_chunk[] = {
|
||||
|
@@ -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[] = {
|
||||
|
Reference in New Issue
Block a user