1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-17 17:32:45 +01:00

Codechange: Add vehicle owner to crash event (#13878)

Co-authored-by: Björn Wärmedal <bjorn.warmedal@lumera.com>
This commit is contained in:
Björn Wärmedal
2025-03-25 22:53:44 +01:00
committed by GitHub
parent fb008436b8
commit d009bfc47b
8 changed files with 24 additions and 13 deletions

View File

@@ -1005,8 +1005,8 @@ static void FloodVehicle(Vehicle *v)
{
uint victims = v->Crash(true);
AI::NewEvent(v->owner, new ScriptEventVehicleCrashed(v->index, v->tile, ScriptEventVehicleCrashed::CRASH_FLOODED, victims));
Game::NewEvent(new ScriptEventVehicleCrashed(v->index, v->tile, ScriptEventVehicleCrashed::CRASH_FLOODED, victims));
AI::NewEvent(v->owner, new ScriptEventVehicleCrashed(v->index, v->tile, ScriptEventVehicleCrashed::CRASH_FLOODED, victims, v->owner));
Game::NewEvent(new ScriptEventVehicleCrashed(v->index, v->tile, ScriptEventVehicleCrashed::CRASH_FLOODED, victims, v->owner));
AddTileNewsItem(GetEncodedString(STR_NEWS_DISASTER_FLOOD_VEHICLE, victims), NewsType::Accident, v->tile);
CreateEffectVehicleRel(v, 4, 4, 8, EV_EXPLOSION_LARGE);
if (_settings_client.sound.disaster) SndPlayVehicleFx(SND_12_EXPLOSION, v);