# HG changeset patch # User rubidium # Date 2007-09-24 20:56:33 # Node ID 149960d8e202ac5bb4d3f9259e27e564125b3ffc # Parent 0fc4bab82f859f625df12386fd24871eeca5a91b (svn r11158) -Codechange: reduce the amount of Random calls needed when we do not have NewGRF industries that actually need the random bits. diff --git a/src/newgrf_industrytiles.cpp b/src/newgrf_industrytiles.cpp --- a/src/newgrf_industrytiles.cpp +++ b/src/newgrf_industrytiles.cpp @@ -358,8 +358,11 @@ bool StartStopIndustryTileAnimation(cons uint32 random = Random(); BEGIN_TILE_LOOP(tile, ind->width, ind->height, ind->xy) if (IsTileType(tile, MP_INDUSTRY) && GetIndustryIndex(tile) == ind->index) { - ret &= StartStopIndustryTileAnimation(tile, iat, random); - SB(random, 0, 16, Random()); + if (StartStopIndustryTileAnimation(tile, iat, random)) { + SB(random, 0, 16, Random()); + } else { + ret = false; + } } END_TILE_LOOP(tile, ind->width, ind->height, ind->xy)