Add: [Script] Include number of victims in ScriptEventVehicleCrashed (#12861)

This commit is contained in:
Loïc Guilloux
2024-07-16 21:28:29 +02:00
committed by GitHub
parent eeed824329
commit d67963e616
8 changed files with 47 additions and 32 deletions

View File

@@ -384,13 +384,13 @@ static bool DisasterTick_Ufo(DisasterVehicle *v)
if (z <= u->z_pos && (u->vehstatus & VS_HIDDEN) == 0) {
v->age++;
if (u->crashed_ctr == 0) {
u->Crash();
uint victims = u->Crash();
u->disaster_vehicle = INVALID_VEHICLE;
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));
AI::NewEvent(u->owner, new ScriptEventVehicleCrashed(u->index, u->tile, ScriptEventVehicleCrashed::CRASH_RV_UFO, victims));
Game::NewEvent(new ScriptEventVehicleCrashed(u->index, u->tile, ScriptEventVehicleCrashed::CRASH_RV_UFO, victims));
}
}