diff options
author | terkhen <terkhen@openttd.org> | 2011-06-12 20:50:03 +0000 |
---|---|---|
committer | terkhen <terkhen@openttd.org> | 2011-06-12 20:50:03 +0000 |
commit | a619ad37897c6ee985aa7bb0dadbd9bbc47c5a63 (patch) | |
tree | 95db697b7650bab2fadc89e43c2e5697bf6040b6 /src/newgrf_industries.cpp | |
parent | 7ffc8c0173cea7b364636e4a0686e72947095a9a (diff) | |
download | openttd-a619ad37897c6ee985aa7bb0dadbd9bbc47c5a63.tar.xz |
(svn r22569) -Feature: [NewGRF] Persistent storage for towns.
Diffstat (limited to 'src/newgrf_industries.cpp')
-rw-r--r-- | src/newgrf_industries.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/newgrf_industries.cpp b/src/newgrf_industries.cpp index 7a06fbc38..35f853712 100644 --- a/src/newgrf_industries.cpp +++ b/src/newgrf_industries.cpp @@ -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) { |