summaryrefslogtreecommitdiff
path: root/src/water_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/water_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/water_cmd.cpp')
-rw-r--r--src/water_cmd.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp
index 5e37c16dd..6a3b73065 100644
--- a/src/water_cmd.cpp
+++ b/src/water_cmd.cpp
@@ -977,7 +977,7 @@ static void FloodVehicle(Vehicle *v)
AI::NewEvent(v->owner, new ScriptEventVehicleCrashed(v->index, v->tile, ScriptEventVehicleCrashed::CRASH_FLOODED));
Game::NewEvent(new ScriptEventVehicleCrashed(v->index, v->tile, ScriptEventVehicleCrashed::CRASH_FLOODED));
SetDParam(0, pass);
- AddVehicleNewsItem(STR_NEWS_DISASTER_FLOOD_VEHICLE, NT_ACCIDENT, v->index);
+ AddTileNewsItem(STR_NEWS_DISASTER_FLOOD_VEHICLE, NT_ACCIDENT, v->tile);
CreateEffectVehicleRel(v, 4, 4, 8, EV_EXPLOSION_LARGE);
if (_settings_client.sound.disaster) SndPlayVehicleFx(SND_12_EXPLOSION, v);
}