(svn r22563) -Codechange: Use a function for storing values inside the persistent storage.

This commit is contained in:
terkhen
2011-06-12 20:38:46 +00:00
parent 713acf1ad3
commit ac4f4447e0
6 changed files with 45 additions and 7 deletions

View File

@@ -184,6 +184,19 @@ static void AirportSetTriggers(const ResolverObject *object, int triggers)
{
}
/**
* Store a value into the object's persistent storage.
* @param object Object that we want to query.
* @param pos Position in the persistent storage to use.
* @param value Value to store.
*/
void AirportStorePSA(ResolverObject *object, uint pos, int32 value)
{
Station *st = object->u.airport.st;
if (object->scope != VSG_SCOPE_SELF || st == NULL) return;
st->airport.psa.Store(pos, value);
}
static void NewAirportResolver(ResolverObject *res, TileIndex tile, Station *st, byte airport_id, byte layout)
{
res->GetRandomBits = AirportGetRandomBits;
@@ -191,8 +204,8 @@ static void NewAirportResolver(ResolverObject *res, TileIndex tile, Station *st,
res->SetTriggers = AirportSetTriggers;
res->GetVariable = AirportGetVariable;
res->ResolveReal = AirportResolveReal;
res->StorePSA = AirportStorePSA;
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;