* Handle the flooding of a vehicle. This sets the vehicle state to crashed, * creates a newsitem and dirties the necessary windows. * @param v The vehicle to flood. */
| 1026 | * @param v The vehicle to flood. |
| 1027 | */ |
| 1028 | static void FloodVehicle(Vehicle *v) |
| 1029 | { |
| 1030 | uint victims = v->Crash(true); |
| 1031 | |
| 1032 | AI::NewEvent(v->owner, new ScriptEventVehicleCrashed(v->index, v->tile, ScriptEventVehicleCrashed::CRASH_FLOODED, victims, v->owner)); |
| 1033 | Game::NewEvent(new ScriptEventVehicleCrashed(v->index, v->tile, ScriptEventVehicleCrashed::CRASH_FLOODED, victims, v->owner)); |
| 1034 | AddTileNewsItem(GetEncodedString(STR_NEWS_DISASTER_FLOOD_VEHICLE, victims), NewsType::Accident, v->tile); |
| 1035 | CreateEffectVehicleRel(v, 4, 4, 8, EV_EXPLOSION_LARGE); |
| 1036 | if (_settings_client.sound.disaster) SndPlayVehicleFx(SND_12_EXPLOSION, v); |
| 1037 | } |
| 1038 | |
| 1039 | /** |
| 1040 | * Flood a vehicle if we are allowed to flood it, i.e. when it is on the ground. |
no test coverage detected