summaryrefslogtreecommitdiff
path: root/src/newgrf_industrytiles.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-09-24 20:56:33 +0000
committerrubidium <rubidium@openttd.org>2007-09-24 20:56:33 +0000
commitc25847af12524ffbcad4019246cf5c41aa22900e (patch)
tree6ac237f23b74ee08219fcbf2dffa5a80f529d1ec /src/newgrf_industrytiles.cpp
parent0ac4f10ca04741076430fabd62883213419f73a8 (diff)
downloadopenttd-c25847af12524ffbcad4019246cf5c41aa22900e.tar.xz
(svn r11158) -Codechange: reduce the amount of Random calls needed when we do not have NewGRF industries that actually need the random bits.
Diffstat (limited to 'src/newgrf_industrytiles.cpp')
-rw-r--r--src/newgrf_industrytiles.cpp7
1 files changed, 5 insertions, 2 deletions
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)