mirror of https://github.com/OpenTTD/OpenTTD
(svn r10639) -Codechange: Give meaninfull name to a magic number
parent
d847b30c98
commit
f9d3463af1
|
@ -20,6 +20,7 @@ enum {
|
||||||
INVALID_INDUSTRYTYPE = NUM_INDUSTRYTYPES, ///< one above amount is considered invalid
|
INVALID_INDUSTRYTYPE = NUM_INDUSTRYTYPES, ///< one above amount is considered invalid
|
||||||
NUM_INDUSTRYTILES = NEW_INDUSTRYTILEOFFSET, ///< total number of industry tiles, new and old
|
NUM_INDUSTRYTILES = NEW_INDUSTRYTILEOFFSET, ///< total number of industry tiles, new and old
|
||||||
INVALID_INDUSTRYTILE = NUM_INDUSTRYTILES, ///< one above amount is considered invalid
|
INVALID_INDUSTRYTILE = NUM_INDUSTRYTILES, ///< one above amount is considered invalid
|
||||||
|
INDUSTRY_COMPLETED = 3, ///< final stage of industry construction.
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
|
|
@ -276,7 +276,7 @@ static void DrawTile_Industry(TileInfo *ti)
|
||||||
}
|
}
|
||||||
|
|
||||||
dits = &_industry_draw_tile_data[gfx << 2 | (indts->anim_state ?
|
dits = &_industry_draw_tile_data[gfx << 2 | (indts->anim_state ?
|
||||||
GetIndustryAnimationState(ti->tile) & 3 :
|
GetIndustryAnimationState(ti->tile) & INDUSTRY_COMPLETED :
|
||||||
GetIndustryConstructionStage(ti->tile))];
|
GetIndustryConstructionStage(ti->tile))];
|
||||||
|
|
||||||
image = dits->ground.sprite;
|
image = dits->ground.sprite;
|
||||||
|
@ -642,9 +642,7 @@ static void MakeIndustryTileBigger(TileIndex tile)
|
||||||
SetIndustryConstructionCounter(tile, 0);
|
SetIndustryConstructionCounter(tile, 0);
|
||||||
SetIndustryConstructionStage(tile, stage);
|
SetIndustryConstructionStage(tile, stage);
|
||||||
StartStopIndustryTileAnimation(tile, IAT_CONSTRUCTION_STATE_CHANGE);
|
StartStopIndustryTileAnimation(tile, IAT_CONSTRUCTION_STATE_CHANGE);
|
||||||
if (stage == 3) {
|
if (stage == INDUSTRY_COMPLETED) SetIndustryCompleted(tile, true);
|
||||||
SetIndustryCompleted(tile, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
MarkTileDirtyByTile(tile);
|
MarkTileDirtyByTile(tile);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue