From e61f197dbaff79ff43244ab99d70009143a66e39 Mon Sep 17 00:00:00 2001 From: rubidium Date: Mon, 24 Sep 2007 20:56:33 +0000 Subject: (svn r11158) -Codechange: reduce the amount of Random calls needed when we do not have NewGRF industries that actually need the random bits. --- src/newgrf_industrytiles.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/newgrf_industrytiles.cpp') diff --git a/src/newgrf_industrytiles.cpp b/src/newgrf_industrytiles.cpp index 5c9d3dbc7..521b545c7 100644 --- a/src/newgrf_industrytiles.cpp +++ b/src/newgrf_industrytiles.cpp @@ -358,8 +358,11 @@ bool StartStopIndustryTileAnimation(const Industry *ind, IndustryAnimationTrigge 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) -- cgit v1.2.3-54-g00ecf