(svn r24283) -Codechange: Add AddTileNewsItem function to preemptively deduplicate code.

This commit is contained in:
frosch
2012-05-26 14:15:57 +00:00
parent 00b3ff80bb
commit a0be398da9
4 changed files with 13 additions and 11 deletions

View File

@@ -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);
}
}
}