summaryrefslogtreecommitdiff
path: root/src/newgrf_house.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-12-16 11:35:05 +0000
committerrubidium <rubidium@openttd.org>2009-12-16 11:35:05 +0000
commitd46127a7237ddd815872941c36bbbd6f7f379852 (patch)
tree48f7bee7b00d55ba274d1ef309dce019ea2f763c /src/newgrf_house.cpp
parentf0728ca1d16b88a9327313e115554e3c6ff0a93f (diff)
downloadopenttd-d46127a7237ddd815872941c36bbbd6f7f379852.tar.xz
(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)
Diffstat (limited to 'src/newgrf_house.cpp')
-rw-r--r--src/newgrf_house.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/newgrf_house.cpp b/src/newgrf_house.cpp
index 681abe4dc..6028dcc4c 100644
--- a/src/newgrf_house.cpp
+++ b/src/newgrf_house.cpp
@@ -439,14 +439,13 @@ void DrawNewHouseTile(TileInfo *ti, HouseID house_id)
NewHouseResolver(&object, house_id, ti->tile, Town::GetByTile(ti->tile));
group = SpriteGroup::Resolve(hs->spritegroup, &object);
- if (group == NULL || group->type != SGT_TILELAYOUT) {
- /* XXX: This is for debugging purposes really, and shouldn't stay. */
- DrawGroundSprite(SPR_SHADOW_CELL, PAL_NONE);
+ const TileLayoutSpriteGroup *tlgroup = (const TileLayoutSpriteGroup *)group;
+ if (group == NULL || group->type != SGT_TILELAYOUT || tlgroup->num_building_stages == 0) {
+ return;
} else {
- const TileLayoutSpriteGroup *tlgroup = (const TileLayoutSpriteGroup *)group;
/* Limit the building stage to the number of stages supplied. */
byte stage = GetHouseBuildingStage(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);
DrawTileLayout(ti, tlgroup, stage, house_id);
}
}