summaryrefslogtreecommitdiff
path: root/src/industry_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-05-26 14:15:57 +0000
committerfrosch <frosch@openttd.org>2012-05-26 14:15:57 +0000
commita0be398da9f80ac316b2d8959ddf96345414dde2 (patch)
tree3c1e5780cc1f3c1209a5e7f0de71934fa088f47a /src/industry_cmd.cpp
parent00b3ff80bbc76bc5546239cfcfa9a4c3591404a1 (diff)
downloadopenttd-a0be398da9f80ac316b2d8959ddf96345414dde2.tar.xz
(svn r24283) -Codechange: Add AddTileNewsItem function to preemptively deduplicate code.
Diffstat (limited to 'src/industry_cmd.cpp')
-rw-r--r--src/industry_cmd.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index e5329e15b..5349f7d93 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -2627,10 +2627,11 @@ static void ChangeIndustryProduction(Industry *i, bool monthly)
SetDParam(0, i->index);
}
/* and report the news to the user */
- AddNewsItem(str,
- ns,
- closeit ? NR_TILE : NR_INDUSTRY,
- closeit ? i->location.tile + TileDiffXY(1, 1) : i->index);
+ if (closeit) {
+ AddTileNewsItem(str, ns, i->location.tile + TileDiffXY(1, 1));
+ } else {
+ AddIndustryNewsItem(str, ns, i->index);
+ }
}
}