src/industry_cmd.cpp
changeset 7699 c750f7b360b9
parent 7695 b15538ba7152
child 7701 72d4e674ca6e
equal deleted inserted replaced
7698:7b2eb61fca53 7699:c750f7b360b9
  1547 			 * be built on the map, so the chance gets lower when the map is fuller, but there
  1547 			 * be built on the map, so the chance gets lower when the map is fuller, but there
  1548 			 * is nothing we can really do about that. */
  1548 			 * is nothing we can really do about that. */
  1549 			if (Random() <= indspec->prospecting_chance) {
  1549 			if (Random() <= indspec->prospecting_chance) {
  1550 				for (int i = 0; i < 5000; i++) {
  1550 				for (int i = 0; i < 5000; i++) {
  1551 					const IndustryTileTable *it = indspec->table[RandomRange(indspec->num_table)];
  1551 					const IndustryTileTable *it = indspec->table[RandomRange(indspec->num_table)];
  1552 					if (CreateNewIndustryHelper(RandomTile(), p1, flags, indspec, it) != NULL) break;
  1552 					const Industry *ind = CreateNewIndustryHelper(RandomTile(), p1, flags, indspec, it);
       
  1553 					if (ind != NULL) {
       
  1554 						SetDParam(0, indspec->name);
       
  1555 						SetDParam(1, ind->town->index);
       
  1556 						AddNewsItem(indspec->new_industry_text,
       
  1557 								NEWS_FLAGS(NM_THIN, NF_VIEWPORT | NF_TILE, NT_OPENCLOSE, 0), ind->xy, 0);
       
  1558 						break;
       
  1559 					}
  1553 				}
  1560 				}
  1554 			}
  1561 			}
  1555 		}
  1562 		}
  1556 	} else {
  1563 	} else {
  1557 		num = indspec->num_table;
  1564 		num = indspec->num_table;