summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaedhros <maedhros@openttd.org>2007-07-08 18:41:34 +0000
committermaedhros <maedhros@openttd.org>2007-07-08 18:41:34 +0000
commit165dd778afbb0f8181c14f5fca4d162311eb8922 (patch)
treedb673ac5604618dc85d75271c0cca608fe77da51
parentfc3764ef4bed671b470d95ea655f34243b163c47 (diff)
downloadopenttd-165dd778afbb0f8181c14f5fca4d162311eb8922.tar.xz
(svn r10481) -Codechange: Show a news message with the new industry when primary industry prospecting succeeds.
-rw-r--r--src/industry_cmd.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index 6429f2ff1..eab7aee83 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -1549,7 +1549,14 @@ CommandCost CmdBuildIndustry(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
if (Random() <= indspec->prospecting_chance) {
for (int i = 0; i < 5000; i++) {
const IndustryTileTable *it = indspec->table[RandomRange(indspec->num_table)];
- if (CreateNewIndustryHelper(RandomTile(), p1, flags, indspec, it) != NULL) break;
+ const Industry *ind = CreateNewIndustryHelper(RandomTile(), p1, flags, indspec, it);
+ if (ind != NULL) {
+ SetDParam(0, indspec->name);
+ SetDParam(1, ind->town->index);
+ AddNewsItem(indspec->new_industry_text,
+ NEWS_FLAGS(NM_THIN, NF_VIEWPORT | NF_TILE, NT_OPENCLOSE, 0), ind->xy, 0);
+ break;
+ }
}
}
}