diff options
author | frosch <frosch@openttd.org> | 2012-05-26 14:15:57 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2012-05-26 14:15:57 +0000 |
commit | a0be398da9f80ac316b2d8959ddf96345414dde2 (patch) | |
tree | 3c1e5780cc1f3c1209a5e7f0de71934fa088f47a /src/disaster_cmd.cpp | |
parent | 00b3ff80bbc76bc5546239cfcfa9a4c3591404a1 (diff) | |
download | openttd-a0be398da9f80ac316b2d8959ddf96345414dde2.tar.xz |
(svn r24283) -Codechange: Add AddTileNewsItem function to preemptively deduplicate code.
Diffstat (limited to 'src/disaster_cmd.cpp')
-rw-r--r-- | src/disaster_cmd.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/disaster_cmd.cpp b/src/disaster_cmd.cpp index 61cf0e120..25e48a772 100644 --- a/src/disaster_cmd.cpp +++ b/src/disaster_cmd.cpp @@ -530,10 +530,7 @@ static bool DisasterTick_Big_Ufo(DisasterVehicle *v) Town *t = ClosestTownFromTile(v->dest_tile, UINT_MAX); SetDParam(0, t->index); - AddNewsItem(STR_NEWS_DISASTER_BIG_UFO, - NS_ACCIDENT, - NR_TILE, - v->tile); + AddTileNewsItem(STR_NEWS_DISASTER_BIG_UFO, NS_ACCIDENT, v->tile); if (!Vehicle::CanAllocateItem(2)) { delete v; @@ -878,8 +875,7 @@ static void Disaster_CoalMine_Init() FOR_ALL_INDUSTRIES(i) { if ((GetIndustrySpec(i->type)->behaviour & INDUSTRYBEH_CAN_SUBSIDENCE) && --index < 0) { SetDParam(0, i->town->index); - AddNewsItem(STR_NEWS_DISASTER_COAL_MINE_SUBSIDENCE, - NS_ACCIDENT, NR_TILE, i->location.tile + TileDiffXY(1, 1)); // keep the news, even when the mine closes + AddTileNewsItem(STR_NEWS_DISASTER_COAL_MINE_SUBSIDENCE, NS_ACCIDENT, i->location.tile + TileDiffXY(1, 1)); // keep the news, even when the mine closes { TileIndex tile = i->location.tile; |