(svn r18514) -Codechange: make it a bit clearer that for tile layouts num_sprites (as in number of sprite sets) is not the same as num_sprites (as in number of building sprites)

This commit is contained in:
rubidium
2009-12-16 11:35:05 +00:00
parent 2aba1ac3fd
commit c719069e05
4 changed files with 14 additions and 15 deletions

View File

@@ -254,12 +254,12 @@ bool DrawNewIndustryTile(TileInfo *ti, Industry *i, IndustryGfx gfx, const Indus
group = SpriteGroup::Resolve(inds->grf_prop.spritegroup, &object);
const TileLayoutSpriteGroup *tlgroup = (const TileLayoutSpriteGroup *)group;
if (group == NULL || group->type != SGT_TILELAYOUT || tlgroup->num_sprites == 0) {
if (group == NULL || group->type != SGT_TILELAYOUT || tlgroup->num_building_stages == 0) {
return false;
} else {
/* 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);
stage = Clamp(stage - 4 + tlgroup->num_building_stages, 0, tlgroup->num_building_stages - 1);
IndustryDrawTileLayout(ti, tlgroup, i->random_colour, stage, gfx);
return true;
}