Changeset - r18601:b58c08244dde
[Not reviewed]
master
0 1 0
yexo - 13 years ago 2011-12-09 16:12:38
yexo@openttd.org
(svn r23458) -Fix: don't assume all industries that cut trees have tile 0,0
-Fix: wait until all tiles of an industry are completed before starting to cut trees
1 file changed with 7 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/industry_cmd.cpp
Show inline comments
 
@@ -1076,10 +1076,14 @@ static bool SearchLumberMillTrees(TileIn
 
 */
 
static void ChopLumberMillTrees(Industry *i)
 
{
 
	/* We only want to cut trees if all tiles are completed. */
 
	TILE_AREA_LOOP(tile_cur, i->location) {
 
		if (i->TileBelongsToIndustry(tile_cur)) {
 
			if (!IsIndustryCompleted(tile_cur)) return;
 
		}
 
	}
 

	
 
	TileIndex tile = i->location.tile;
 

	
 
	if (!IsIndustryCompleted(tile)) return;  // Can't proceed if not completed.
 

	
 
	if (CircularTileSearch(&tile, 40, SearchLumberMillTrees, NULL)) { // 40x40 tiles  to search.
 
		i->produced_cargo_waiting[0] = min(0xffff, i->produced_cargo_waiting[0] + 45); // Found a tree, add according value to waiting cargo.
 
	}
0 comments (0 inline, 0 general)