Mercurial > hg > openttd
changeset 7291:33e19e1c88ff draft
(svn r10639) -Codechange: Give meaninfull name to a magic number
author | belugas <belugas@openttd.org> |
---|---|
date | Fri, 20 Jul 2007 17:14:03 +0000 |
parents | 67fc3fc08a7b |
children | 3167252a854d |
files | src/industry.h src/industry_cmd.cpp |
diffstat | 2 files changed, 3 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/industry.h +++ b/src/industry.h @@ -20,6 +20,7 @@ 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 {
--- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -276,7 +276,7 @@ } 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 @@ 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);