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.
This commit is contained in:
Patric Stout
2021-01-05 21:39:23 +01:00
committed by GitHub
parent 0fd2108f7f
commit dff7ee8e1c
6 changed files with 10 additions and 14 deletions

View File

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