src/industry_cmd.cpp
branchnoai
changeset 11126 72d4c9314c72
parent 10955 56b381e5253f
equal deleted inserted replaced
11111:1b984dab8cec 11126:72d4c9314c72
   961 }
   961 }
   962 
   962 
   963 /**
   963 /**
   964  * Search callback function for ChopLumberMillTrees
   964  * Search callback function for ChopLumberMillTrees
   965  * @param tile to test
   965  * @param tile to test
   966  * @param data that is passed by the caller.  In this case, nothing
   966  * @param user_data that is passed by the caller.  In this case, nothing
   967  * @return the result of the test
   967  * @return the result of the test
   968  */
   968  */
   969 static bool SearchLumberMillTrees(TileIndex tile, uint32 data)
   969 static bool SearchLumberMillTrees(TileIndex tile, void *user_data)
   970 {
   970 {
   971 	if (IsTileType(tile, MP_TREES) && GetTreeGrowth(tile) > 2) { ///< 3 and up means all fully grown trees
   971 	if (IsTileType(tile, MP_TREES) && GetTreeGrowth(tile) > 2) { ///< 3 and up means all fully grown trees
   972 		PlayerID old_player = _current_player;
   972 		PlayerID old_player = _current_player;
   973 		/* found a tree */
   973 		/* found a tree */
   974 
   974 
   993 {
   993 {
   994 	TileIndex tile = i->xy;
   994 	TileIndex tile = i->xy;
   995 
   995 
   996 	if (!IsIndustryCompleted(tile)) return;  ///< Can't proceed if not completed
   996 	if (!IsIndustryCompleted(tile)) return;  ///< Can't proceed if not completed
   997 
   997 
   998 	if (CircularTileSearch(&tile, 40, SearchLumberMillTrees, 0)) ///< 40x40 tiles  to search
   998 	if (CircularTileSearch(&tile, 40, SearchLumberMillTrees, NULL)) ///< 40x40 tiles  to search
   999 		i->produced_cargo_waiting[0] = min(0xffff, i->produced_cargo_waiting[0] + 45); ///< Found a tree, add according value to waiting cargo
   999 		i->produced_cargo_waiting[0] = min(0xffff, i->produced_cargo_waiting[0] + 45); ///< Found a tree, add according value to waiting cargo
  1000 }
  1000 }
  1001 
  1001 
  1002 static void ProduceIndustryGoods(Industry *i)
  1002 static void ProduceIndustryGoods(Industry *i)
  1003 {
  1003 {