summaryrefslogtreecommitdiff
path: root/src/industry_cmd.cpp
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2007-03-09 02:04:07 +0000
committerbelugas <belugas@openttd.org>2007-03-09 02:04:07 +0000
commitb95daaf434d2e64a66f5b4776996da5c9a9b180f (patch)
treee171c212aaf14d2b580b79923f3334f89698d31a /src/industry_cmd.cpp
parent921d4f58cb4d831f53c390f5c7280901ae6b3468 (diff)
downloadopenttd-b95daaf434d2e64a66f5b4776996da5c9a9b180f.tar.xz
(svn r9075) -Codechange: Cleanup of industry_cmd (Step-7). Small step that is. The new industry messages do not need a series of tests. Only one property to use.
Diffstat (limited to 'src/industry_cmd.cpp')
-rw-r--r--src/industry_cmd.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index cdbf0fe40..5be05d0ea 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -1731,11 +1731,10 @@ static const byte _new_industry_rand[4][32] = {
static void MaybeNewIndustry(uint32 r)
{
- int type;
+ int type =_new_industry_rand[_opt.landscape][GB(r, 16, 5)];
int j;
Industry *i;
-
- type = _new_industry_rand[_opt.landscape][GB(r, 16, 5)];
+ const IndustrySpec *ind_spc = GetIndustrySpec(type);;
if (type == IT_OIL_WELL && _cur_year > 1950) return;
if (type == IT_OIL_RIG && _cur_year < 1960) return;
@@ -1747,13 +1746,10 @@ static void MaybeNewIndustry(uint32 r)
if (--j == 0) return;
}
- SetDParam(0, GetIndustrySpec(type)->name);
+ SetDParam(0, ind_spc->name);
SetDParam(1, i->town->index);
- AddNewsItem(
- (type != IT_FOREST && type != IT_FRUIT_PLANTATION && type != IT_RUBBER_PLANTATION && type != IT_COTTON_CANDY) ?
- STR_482D_NEW_UNDER_CONSTRUCTION : STR_482E_NEW_BEING_PLANTED_NEAR,
- NEWS_FLAGS(NM_THIN, NF_VIEWPORT|NF_TILE, NT_ECONOMY,0), i->xy, 0
- );
+ AddNewsItem(ind_spc->new_industry_text,
+ NEWS_FLAGS(NM_THIN, NF_VIEWPORT|NF_TILE, NT_ECONOMY,0), i->xy, 0);
}
static void ChangeIndustryProduction(Industry *i)