(svn r22569) -Feature: [NewGRF] Persistent storage for towns.

This commit is contained in:
terkhen
2011-06-12 20:50:03 +00:00
parent 7ffc8c0173
commit a619ad3789
8 changed files with 126 additions and 11 deletions

View File

@@ -191,7 +191,7 @@ uint32 IndustryGetVariable(const ResolverObject *object, byte variable, byte par
return UINT_MAX;
}
return TownGetVariable(variable, parameter, available, t);
return TownGetVariable(variable, parameter, available, t, object->grffile);
}
if (industry == NULL) {
@@ -385,7 +385,13 @@ static void IndustrySetTriggers(const ResolverObject *object, int triggers)
void IndustryStorePSA(ResolverObject *object, uint pos, int32 value)
{
Industry *ind = object->u.industry.ind;
if (object->scope != VSG_SCOPE_SELF || ind->index == INVALID_INDUSTRY) return;
if (ind->index == INVALID_INDUSTRY) return;
if (object->scope != VSG_SCOPE_SELF) {
/* Pass the request on to the town of the industry. */
TownStorePSA(ind->town, object->grffile, pos, value);
return;
}
if (ind->psa == NULL) {
/* There is no need to create a storage if the value is zero. */
@@ -459,7 +465,7 @@ uint32 IndustryLocationGetVariable(const ResolverObject *object, byte variable,
TileIndex tile = object->u.industry.tile;
if (object->scope == VSG_SCOPE_PARENT) {
return TownGetVariable(variable, parameter, available, industry->town);
return TownGetVariable(variable, parameter, available, industry->town, object->grffile);
}
switch (variable) {