(svn r10481) -Codechange: Show a news message with the new industry when primary industry prospecting succeeds.
authormaedhros
Sun, 08 Jul 2007 18:41:34 +0000
changeset 7203 39f68ddb39cc
parent 7202 dc312a87f450
child 7204 ef8181ff2c1e
(svn r10481) -Codechange: Show a news message with the new industry when primary industry prospecting succeeds.
src/industry_cmd.cpp
--- a/src/industry_cmd.cpp	Sun Jul 08 18:40:15 2007 +0000
+++ b/src/industry_cmd.cpp	Sun Jul 08 18:41:34 2007 +0000
@@ -1549,7 +1549,14 @@
 			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;
+					}
 				}
 			}
 		}