1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-16 08:52:40 +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

@@ -3152,8 +3152,8 @@ static uint TrainCrashed(Train *v)
/* do not crash train twice */
if (!v->vehstatus.Test(VehState::Crashed)) {
victims = v->Crash();
AI::NewEvent(v->owner, new ScriptEventVehicleCrashed(v->index, v->tile, ScriptEventVehicleCrashed::CRASH_TRAIN, victims));
Game::NewEvent(new ScriptEventVehicleCrashed(v->index, v->tile, ScriptEventVehicleCrashed::CRASH_TRAIN, victims));
AI::NewEvent(v->owner, new ScriptEventVehicleCrashed(v->index, v->tile, ScriptEventVehicleCrashed::CRASH_TRAIN, victims, v->owner));
Game::NewEvent(new ScriptEventVehicleCrashed(v->index, v->tile, ScriptEventVehicleCrashed::CRASH_TRAIN, victims, v->owner));
}
/* Try to re-reserve track under already crashed train too.