summaryrefslogtreecommitdiff
path: root/src/table/newgrf_debug_data.h
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2011-06-12 20:47:45 +0000
committerterkhen <terkhen@openttd.org>2011-06-12 20:47:45 +0000
commit00e5c1df18449992cc974b99c61a44d1385bf4a7 (patch)
tree7433db92049848236fe05f18b99d6f80c99442c6 /src/table/newgrf_debug_data.h
parent9f55abf51aac0f408e60d905fb2ac1b8a1405bb9 (diff)
downloadopenttd-00e5c1df18449992cc974b99c61a44d1385bf4a7.tar.xz
(svn r22567) -Codechange: Store persistent storages inside a pool.
Diffstat (limited to 'src/table/newgrf_debug_data.h')
-rw-r--r--src/table/newgrf_debug_data.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/table/newgrf_debug_data.h b/src/table/newgrf_debug_data.h
index 39e9ee4a6..5bed44310 100644
--- a/src/table/newgrf_debug_data.h
+++ b/src/table/newgrf_debug_data.h
@@ -291,12 +291,13 @@ class NIHIndustry : public NIHelper {
const void *GetSpec(uint index) const { return GetIndustrySpec(Industry::Get(index)->type); }
void SetStringParameters(uint index) const { this->SetSimpleStringParameters(STR_INDUSTRY_NAME, index); }
void Resolve(ResolverObject *ro, uint32 index) const { extern void GetIndustryResolver(ResolverObject *ro, uint index); GetIndustryResolver(ro, index); }
- uint GetPSASize(uint index, uint32 grfid) const { return cpp_lengthof(Industry, psa.storage); }
+ uint GetPSASize(uint index, uint32 grfid) const { return cpp_lengthof(PersistentStorage, storage); }
int32 *GetPSAFirstPosition(uint index, uint32 grfid) const
{
- const void *base = this->GetInstance(index);
- return (int32*)((byte*)base + cpp_offsetof(Industry, psa.storage));
+ Industry *i = (Industry *)this->GetInstance(index);
+ if (i->psa == NULL) return NULL;
+ return (int32 *)(&i->psa->storage);
}
};