(svn r18761) -Fix [FS#3497]: Spritelayouts do not need an Action 1 if only using default sprites.

This commit is contained in:
frosch
2010-01-08 20:42:12 +00:00
parent f5b6bae7ca
commit 340f5e8569
3 changed files with 28 additions and 12 deletions

View File

@@ -253,11 +253,11 @@ bool DrawNewIndustryTile(TileInfo *ti, Industry *i, IndustryGfx gfx, const Indus
NewIndustryTileResolver(&object, gfx, ti->tile, i);
group = SpriteGroup::Resolve(inds->grf_prop.spritegroup, &object);
const TileLayoutSpriteGroup *tlgroup = (const TileLayoutSpriteGroup *)group;
if (group == NULL || group->type != SGT_TILELAYOUT || tlgroup->num_building_stages == 0) {
if (group == NULL || group->type != SGT_TILELAYOUT) {
return false;
} else {
/* Limit the building stage to the number of stages supplied. */
const TileLayoutSpriteGroup *tlgroup = (const TileLayoutSpriteGroup *)group;
byte stage = GetIndustryConstructionStage(ti->tile);
stage = Clamp(stage - 4 + tlgroup->num_building_stages, 0, tlgroup->num_building_stages - 1);
IndustryDrawTileLayout(ti, tlgroup, i->random_colour, stage, gfx);