diff --git a/src/newgrf_industrytiles.cpp b/src/newgrf_industrytiles.cpp --- a/src/newgrf_industrytiles.cpp +++ b/src/newgrf_industrytiles.cpp @@ -253,10 +253,10 @@ bool DrawNewIndustryTile(TileInfo *ti, I NewIndustryTileResolver(&object, gfx, ti->tile, i); group = SpriteGroup::Resolve(inds->grf_prop.spritegroup, &object); - if (group == NULL || group->type != SGT_TILELAYOUT) { + const TileLayoutSpriteGroup *tlgroup = (const TileLayoutSpriteGroup *)group; + if (group == NULL || group->type != SGT_TILELAYOUT || tlgroup->num_sprites == 0) { return false; } else { - const TileLayoutSpriteGroup *tlgroup = (const TileLayoutSpriteGroup *)group; /* Limit the building stage to the number of stages supplied. */ byte stage = GetIndustryConstructionStage(ti->tile); stage = Clamp(stage - 4 + tlgroup->num_sprites, 0, tlgroup->num_sprites - 1);