(svn r11158) -Codechange: reduce the amount of Random calls needed when we do not have NewGRF industries that actually need the random bits.
authorrubidium
Mon, 24 Sep 2007 20:56:33 +0000
changeset 8123 2f8dfb527d7c
parent 8122 778b62a734ff
child 8124 beda591abd6c
(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
--- a/src/newgrf_industrytiles.cpp	Mon Sep 24 20:55:13 2007 +0000
+++ b/src/newgrf_industrytiles.cpp	Mon Sep 24 20:56:33 2007 +0000
@@ -358,8 +358,11 @@
 	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)