(svn r16711) -Codechange: use FOR_ALL_SUBSIDIES macro when iterating over all subsidies
This commit is contained in:
@@ -1916,8 +1916,8 @@ bool AfterLoadGame()
|
||||
}
|
||||
|
||||
/* Delete invalid subsidies possibly present in old versions (but converted to new savegame) */
|
||||
for (Subsidy *s = _subsidies; s < endof(_subsidies); s++) {
|
||||
if (s->cargo_type == CT_INVALID) continue;
|
||||
Subsidy *s;
|
||||
FOR_ALL_SUBSIDIES(s) {
|
||||
if (s->age >= 12) {
|
||||
/* Station -> Station */
|
||||
const Station *from = Station::GetIfValid(s->from);
|
||||
|
@@ -19,15 +19,10 @@ static const SaveLoad _subsidies_desc[] = {
|
||||
|
||||
void Save_SUBS()
|
||||
{
|
||||
int i;
|
||||
Subsidy *s;
|
||||
|
||||
for (i = 0; i != lengthof(_subsidies); i++) {
|
||||
s = &_subsidies[i];
|
||||
if (s->cargo_type != CT_INVALID) {
|
||||
SlSetArrayIndex(i);
|
||||
SlObject(s, _subsidies_desc);
|
||||
}
|
||||
FOR_ALL_SUBSIDIES(s) {
|
||||
SlSetArrayIndex(s - _subsidies);
|
||||
SlObject(s, _subsidies_desc);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user