summaryrefslogtreecommitdiff
path: root/src/news_func.h
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-01-05 21:39:23 +0100
committerGitHub <noreply@github.com>2021-01-05 21:39:23 +0100
commitdff7ee8e1c68199a0dc105e82e588ac097543645 (patch)
tree317e29ae8a6d1db52f5e7cebf26356559c5193f8 /src/news_func.h
parent0fd2108f7ffe53faac468e82879e46c830df4038 (diff)
downloadopenttd-dff7ee8e1c68199a0dc105e82e588ac097543645.tar.xz
Fix #7611: keeps news about accidents around after vehicle is cleaned up (#8497)
When a vehicle is cleaned up, all news that points to the news is also removed. This was a bit evil, as it would also remove any news related to crashed, acting like the crash never happened. This left players a bit in the dark what was going on exactly.
Diffstat (limited to 'src/news_func.h')
-rw-r--r--src/news_func.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/news_func.h b/src/news_func.h
index 352193f1e..2131c8a74 100644
--- a/src/news_func.h
+++ b/src/news_func.h
@@ -42,9 +42,9 @@ static inline void AddVehicleAdviceNewsItem(StringID string, VehicleID vehicle)
AddNewsItem(string, NT_ADVICE, NF_INCOLOUR | NF_SMALL | NF_VEHICLE_PARAM0, NR_VEHICLE, vehicle);
}
-static inline void AddTileNewsItem(StringID string, NewsType type, TileIndex tile, void *free_data = nullptr)
+static inline void AddTileNewsItem(StringID string, NewsType type, TileIndex tile, void *free_data = nullptr, StationID station = INVALID_STATION)
{
- AddNewsItem(string, type, NF_NO_TRANSPARENT | NF_SHADE | NF_THIN, NR_TILE, tile, NR_NONE, UINT32_MAX, free_data);
+ AddNewsItem(string, type, NF_NO_TRANSPARENT | NF_SHADE | NF_THIN, NR_TILE, tile, station == INVALID_STATION ? NR_NONE : NR_STATION, station, free_data);
}
static inline void AddIndustryNewsItem(StringID string, NewsType type, IndustryID industry)