From 71637303a9cf9d9e28fa9d4fcb2d6612d4607149 Mon Sep 17 00:00:00 2001 From: belugas Date: Fri, 20 Jul 2007 17:14:03 +0000 Subject: (svn r10639) -Codechange: Give meaninfull name to a magic number --- src/industry.h | 1 + src/industry_cmd.cpp | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/industry.h b/src/industry.h index 96d4dc4ef..e6f17492d 100644 --- a/src/industry.h +++ b/src/industry.h @@ -20,6 +20,7 @@ enum { INVALID_INDUSTRYTYPE = NUM_INDUSTRYTYPES, ///< one above amount is considered invalid NUM_INDUSTRYTILES = NEW_INDUSTRYTILEOFFSET, ///< total number of industry tiles, new and old INVALID_INDUSTRYTILE = NUM_INDUSTRYTILES, ///< one above amount is considered invalid + INDUSTRY_COMPLETED = 3, ///< final stage of industry construction. }; enum { diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index 75afe3f90..80d5b472b 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -276,7 +276,7 @@ static void DrawTile_Industry(TileInfo *ti) } dits = &_industry_draw_tile_data[gfx << 2 | (indts->anim_state ? - GetIndustryAnimationState(ti->tile) & 3 : + GetIndustryAnimationState(ti->tile) & INDUSTRY_COMPLETED : GetIndustryConstructionStage(ti->tile))]; image = dits->ground.sprite; @@ -642,9 +642,7 @@ static void MakeIndustryTileBigger(TileIndex tile) SetIndustryConstructionCounter(tile, 0); SetIndustryConstructionStage(tile, stage); StartStopIndustryTileAnimation(tile, IAT_CONSTRUCTION_STATE_CHANGE); - if (stage == 3) { - SetIndustryCompleted(tile, true); - } + if (stage == INDUSTRY_COMPLETED) SetIndustryCompleted(tile, true); MarkTileDirtyByTile(tile); -- cgit v1.2.3-54-g00ecf