changeset 6266 | fd42b0893130 |
parent 6247 | 7d81e3a5d803 |
child 6283 | f9d97d412b0f |
6265:808ed372b237 | 6266:fd42b0893130 |
---|---|
1729 {30, 30, 30, 36, 36, 31, 31, 31, 27, 27, 27, 28, 28, 28, 26, 26, 26, 34, 34, 34, 35, 35, 35, 29, 29, 29, 32, 32, 32, 33, 33, 33}, |
1729 {30, 30, 30, 36, 36, 31, 31, 31, 27, 27, 27, 28, 28, 28, 26, 26, 26, 34, 34, 34, 35, 35, 35, 29, 29, 29, 32, 32, 32, 33, 33, 33}, |
1730 }; |
1730 }; |
1731 |
1731 |
1732 static void MaybeNewIndustry(uint32 r) |
1732 static void MaybeNewIndustry(uint32 r) |
1733 { |
1733 { |
1734 int type; |
1734 int type =_new_industry_rand[_opt.landscape][GB(r, 16, 5)]; |
1735 int j; |
1735 int j; |
1736 Industry *i; |
1736 Industry *i; |
1737 |
1737 const IndustrySpec *ind_spc = GetIndustrySpec(type);; |
1738 type = _new_industry_rand[_opt.landscape][GB(r, 16, 5)]; |
|
1739 |
1738 |
1740 if (type == IT_OIL_WELL && _cur_year > 1950) return; |
1739 if (type == IT_OIL_WELL && _cur_year > 1950) return; |
1741 if (type == IT_OIL_RIG && _cur_year < 1960) return; |
1740 if (type == IT_OIL_RIG && _cur_year < 1960) return; |
1742 |
1741 |
1743 j = 2000; |
1742 j = 2000; |
1745 i = CreateNewIndustry(RandomTile(), type); |
1744 i = CreateNewIndustry(RandomTile(), type); |
1746 if (i != NULL) break; |
1745 if (i != NULL) break; |
1747 if (--j == 0) return; |
1746 if (--j == 0) return; |
1748 } |
1747 } |
1749 |
1748 |
1750 SetDParam(0, GetIndustrySpec(type)->name); |
1749 SetDParam(0, ind_spc->name); |
1751 SetDParam(1, i->town->index); |
1750 SetDParam(1, i->town->index); |
1752 AddNewsItem( |
1751 AddNewsItem(ind_spc->new_industry_text, |
1753 (type != IT_FOREST && type != IT_FRUIT_PLANTATION && type != IT_RUBBER_PLANTATION && type != IT_COTTON_CANDY) ? |
1752 NEWS_FLAGS(NM_THIN, NF_VIEWPORT|NF_TILE, NT_ECONOMY,0), i->xy, 0); |
1754 STR_482D_NEW_UNDER_CONSTRUCTION : STR_482E_NEW_BEING_PLANTED_NEAR, |
|
1755 NEWS_FLAGS(NM_THIN, NF_VIEWPORT|NF_TILE, NT_ECONOMY,0), i->xy, 0 |
|
1756 ); |
|
1757 } |
1753 } |
1758 |
1754 |
1759 static void ChangeIndustryProduction(Industry *i) |
1755 static void ChangeIndustryProduction(Industry *i) |
1760 { |
1756 { |
1761 bool only_decrease = false; |
1757 bool only_decrease = false; |