summaryrefslogtreecommitdiff
path: root/src/unmovable_cmd.cpp
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2009-01-28 19:57:23 +0000
committerbelugas <belugas@openttd.org>2009-01-28 19:57:23 +0000
commit3671ed9e4f4b773cd03bfe7a4544bf78e61d1604 (patch)
tree0f8ac458ad049e4b952bb5f78a8a4a0eab88c268 /src/unmovable_cmd.cpp
parentbfde9f7eefd4fe796002374797df699db90ae773 (diff)
downloadopenttd-3671ed9e4f4b773cd03bfe7a4544bf78e61d1604.tar.xz
(svn r15290) -Codechange: Isolate size and section of the UnMovable HQ object, in order to keep the Unmovable type free of any irrelevant data
Diffstat (limited to 'src/unmovable_cmd.cpp')
-rw-r--r--src/unmovable_cmd.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/unmovable_cmd.cpp b/src/unmovable_cmd.cpp
index f6eb3ea70..adcc57bac 100644
--- a/src/unmovable_cmd.cpp
+++ b/src/unmovable_cmd.cpp
@@ -167,6 +167,7 @@ static void DrawTile_Unmovable(TileInfo *ti)
{
switch (GetUnmovableType(ti->tile)) {
+ default: NOT_REACHED(); break;
case UNMOVABLE_TRANSMITTER:
case UNMOVABLE_LIGHTHOUSE: {
const DrawTileSeqStruct *dtu = &_draw_tile_transmitterlighthouse_data[GetUnmovableType(ti->tile)];
@@ -205,13 +206,13 @@ static void DrawTile_Unmovable(TileInfo *ti)
DrawBridgeMiddle(ti);
break;
- default: {
+ case UNMOVABLE_HQ:{
assert(IsCompanyHQ(ti->tile));
if (ti->tileh != SLOPE_FLAT) DrawFoundation(ti, FOUNDATION_LEVELED);
SpriteID palette = COMPANY_SPRITE_COLOR(GetTileOwner(ti->tile));
- const DrawTileSprites *t = &_unmovable_display_datas[GetCompanyHQSection(ti->tile)];
+ const DrawTileSprites *t = &_unmovable_display_datas[GetCompanyHQSize(ti->tile) << 2 | GetCompanyHQSection(ti->tile)];
DrawGroundSprite(t->ground.sprite, palette);
if (IsInvisibilitySet(TO_STRUCTURES)) break;