(svn r9644) -Codechange: if else cascade into a switch case
This commit is contained in:
@@ -458,23 +458,22 @@ static void AnimateTile_Industry(TileIndex tile)
|
|||||||
if ((_tick_counter & 1) == 0) {
|
if ((_tick_counter & 1) == 0) {
|
||||||
m = GetIndustryAnimationState(tile) + 1;
|
m = GetIndustryAnimationState(tile) + 1;
|
||||||
|
|
||||||
if (m == 1) {
|
switch (m) {
|
||||||
SndPlayTileFx(SND_2C_MACHINERY, tile);
|
case 1: SndPlayTileFx(SND_2C_MACHINERY, tile); break;
|
||||||
} else if (m == 23) {
|
case 23: SndPlayTileFx(SND_2B_COMEDY_HIT, tile); break;
|
||||||
SndPlayTileFx(SND_2B_COMEDY_HIT, tile);
|
case 28: SndPlayTileFx(SND_2A_EXTRACT_AND_POP, tile); break;
|
||||||
} else if (m == 28) {
|
default:
|
||||||
SndPlayTileFx(SND_2A_EXTRACT_AND_POP, tile);
|
if (m >= 50) {
|
||||||
|
int n = GetIndustryAnimationLoop(tile) + 1;
|
||||||
|
m = 0;
|
||||||
|
if (n >= 8) {
|
||||||
|
n = 0;
|
||||||
|
DeleteAnimatedTile(tile);
|
||||||
|
}
|
||||||
|
SetIndustryAnimationLoop(tile, n);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m >= 50) {
|
|
||||||
int n = GetIndustryAnimationLoop(tile) + 1;
|
|
||||||
m = 0;
|
|
||||||
if (n >= 8) {
|
|
||||||
n = 0;
|
|
||||||
DeleteAnimatedTile(tile);
|
|
||||||
}
|
|
||||||
SetIndustryAnimationLoop(tile, n);
|
|
||||||
}
|
|
||||||
SetIndustryAnimationState(tile, m);
|
SetIndustryAnimationState(tile, m);
|
||||||
MarkTileDirtyByTile(tile);
|
MarkTileDirtyByTile(tile);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user