summaryrefslogtreecommitdiff
path: root/src/newgrf_industries.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/newgrf_industries.cpp')
-rw-r--r--src/newgrf_industries.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/newgrf_industries.cpp b/src/newgrf_industries.cpp
index b17c5a8d2..22c20495f 100644
--- a/src/newgrf_industries.cpp
+++ b/src/newgrf_industries.cpp
@@ -376,6 +376,19 @@ static void IndustrySetTriggers(const ResolverObject *object, int triggers)
ind->random_triggers = 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 IndustryStorePSA(ResolverObject *object, uint pos, int32 value)
+{
+ Industry *ind = object->u.industry.ind;
+ if (object->scope != VSG_SCOPE_SELF || ind->index == INVALID_INDUSTRY) return;
+ ind->psa.Store(pos, value);
+}
+
static void NewIndustryResolver(ResolverObject *res, TileIndex tile, Industry *indus, IndustryType type)
{
res->GetRandomBits = IndustryGetRandomBits;
@@ -383,8 +396,8 @@ static void NewIndustryResolver(ResolverObject *res, TileIndex tile, Industry *i
res->SetTriggers = IndustrySetTriggers;
res->GetVariable = IndustryGetVariable;
res->ResolveReal = IndustryResolveReal;
+ res->StorePSA = IndustryStorePSA;
- res->psa = &indus->psa;
res->u.industry.tile = tile;
res->u.industry.ind = indus;
res->u.industry.gfx = INVALID_INDUSTRYTILE;