(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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user