diff options
author | Patric Stout <truebrain@openttd.org> | 2021-01-05 21:39:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-05 21:39:23 +0100 |
commit | dff7ee8e1c68199a0dc105e82e588ac097543645 (patch) | |
tree | 317e29ae8a6d1db52f5e7cebf26356559c5193f8 /src/disaster_vehicle.cpp | |
parent | 0fd2108f7ffe53faac468e82879e46c830df4038 (diff) | |
download | openttd-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/disaster_vehicle.cpp')
-rw-r--r-- | src/disaster_vehicle.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/disaster_vehicle.cpp b/src/disaster_vehicle.cpp index a6059b244..12217bb61 100644 --- a/src/disaster_vehicle.cpp +++ b/src/disaster_vehicle.cpp @@ -243,7 +243,7 @@ static bool DisasterTick_Zeppeliner(DisasterVehicle *v) v->age = 0; SetDParam(0, GetStationIndex(v->tile)); - AddVehicleNewsItem(STR_NEWS_DISASTER_ZEPPELIN, NT_ACCIDENT, v->index); // Delete the news, when the zeppelin is gone + AddTileNewsItem(STR_NEWS_DISASTER_ZEPPELIN, NT_ACCIDENT, v->tile); AI::NewEvent(GetTileOwner(v->tile), new ScriptEventDisasterZeppelinerCrashed(GetStationIndex(v->tile))); } } @@ -377,7 +377,7 @@ static bool DisasterTick_Ufo(DisasterVehicle *v) if (u->crashed_ctr == 0) { u->Crash(); - AddVehicleNewsItem(STR_NEWS_DISASTER_SMALL_UFO, NT_ACCIDENT, u->index); // delete the news, when the roadvehicle is gone + AddTileNewsItem(STR_NEWS_DISASTER_SMALL_UFO, NT_ACCIDENT, u->tile); AI::NewEvent(u->owner, new ScriptEventVehicleCrashed(u->index, u->tile, ScriptEventVehicleCrashed::CRASH_RV_UFO)); Game::NewEvent(new ScriptEventVehicleCrashed(u->index, u->tile, ScriptEventVehicleCrashed::CRASH_RV_UFO)); @@ -456,7 +456,7 @@ static bool DisasterTick_Aircraft(DisasterVehicle *v, uint16 image_override, boo DestructIndustry(i); SetDParam(0, i->town->index); - AddIndustryNewsItem(news_message, NT_ACCIDENT, i->index); // delete the news, when the industry closes + AddTileNewsItem(news_message, NT_ACCIDENT, v->dest_tile); if (_settings_client.sound.disaster) SndPlayTileFx(SND_12_EXPLOSION, i->location.tile); } } else if (v->current_order.GetDestination() == 0) { |