summaryrefslogtreecommitdiff
path: root/src/roadveh_cmd.cpp
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/roadveh_cmd.cpp
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/roadveh_cmd.cpp')
-rw-r--r--src/roadveh_cmd.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index 68b81ad0d..14fa8d79d 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -552,12 +552,8 @@ static void RoadVehCrash(RoadVehicle *v)
Game::NewEvent(new ScriptEventVehicleCrashed(v->index, v->tile, ScriptEventVehicleCrashed::CRASH_RV_LEVEL_CROSSING));
SetDParam(0, pass);
- AddVehicleNewsItem(
- (pass == 1) ?
- STR_NEWS_ROAD_VEHICLE_CRASH_DRIVER : STR_NEWS_ROAD_VEHICLE_CRASH,
- NT_ACCIDENT,
- v->index
- );
+ StringID newsitem = (pass == 1) ? STR_NEWS_ROAD_VEHICLE_CRASH_DRIVER : STR_NEWS_ROAD_VEHICLE_CRASH;
+ AddTileNewsItem(newsitem, NT_ACCIDENT, v->tile);
ModifyStationRatingAround(v->tile, v->owner, -160, 22);
if (_settings_client.sound.disaster) SndPlayVehicleFx(SND_12_EXPLOSION, v);