Fix #248: Crash in debug window -> parent button for non-GRF industries

This commit is contained in:
Jonathan G Rennison 2021-04-25 00:12:57 +01:00
parent e6a858c0dc
commit e3193e7b9e

View File

@ -619,7 +619,7 @@ class NIHIndustry : public NIHelper {
const void *GetInstance(uint index)const override { return Industry::Get(index); } const void *GetInstance(uint index)const override { return Industry::Get(index); }
const void *GetSpec(uint index) const override { return GetIndustrySpec(Industry::Get(index)->type); } const void *GetSpec(uint index) const override { return GetIndustrySpec(Industry::Get(index)->type); }
void SetStringParameters(uint index) const override { this->SetSimpleStringParameters(STR_INDUSTRY_NAME, index); } void SetStringParameters(uint index) const override { this->SetSimpleStringParameters(STR_INDUSTRY_NAME, index); }
uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? GetIndustrySpec(Industry::Get(index)->type)->grf_prop.grffile->grfid : 0; } uint32 GetGRFID(uint index) const override { return (!this->ShowExtraInfoOnly(index)) ? GetIndustrySpec(Industry::Get(index)->type)->grf_prop.grffile->grfid : 0; }
uint Resolve(uint index, uint var, uint param, GetVariableExtra *extra) const override uint Resolve(uint index, uint var, uint param, GetVariableExtra *extra) const override
{ {