diff options
author | yexo <yexo@openttd.org> | 2010-08-05 12:06:13 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2010-08-05 12:06:13 +0000 |
commit | 2e6713ce956d42f55f0f6f34fe12ec8459dc0ab4 (patch) | |
tree | 79f6f1582cab37d6fd7ae03b8095147d85fb846d /src/newgrf_airport.cpp | |
parent | 00902294b3077c163df1917121c5bb9a7b48e179 (diff) | |
download | openttd-2e6713ce956d42f55f0f6f34fe12ec8459dc0ab4.tar.xz |
(svn r20374) -Codechange: add persistant storage for airports
Diffstat (limited to 'src/newgrf_airport.cpp')
-rw-r--r-- | src/newgrf_airport.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/newgrf_airport.cpp b/src/newgrf_airport.cpp index d077ae14f..23e6dff3d 100644 --- a/src/newgrf_airport.cpp +++ b/src/newgrf_airport.cpp @@ -263,6 +263,9 @@ uint32 AirportGetVariable(const ResolverObject *object, byte variable, byte para } switch (variable) { + /* Get a variable from the persistent storage */ + case 0x7C: return st->airport.psa.Get(parameter); + case 0xF0: return st->facilities; case 0xFA: return Clamp(st->build_date - DAYS_TILL_ORIGINAL_BASE_YEAR, 0, 65535); } @@ -304,7 +307,7 @@ static void NewAirportResolver(ResolverObject *res, TileIndex tile, Station *st, res->GetVariable = AirportGetVariable; res->ResolveReal = AirportResolveReal; - res->psa = NULL; + res->psa = st != NULL ? &st->airport.psa : NULL; res->u.airport.st = st; res->u.airport.airport_id = airport_id; res->u.airport.layout = layout; |