| 553 | } |
| 554 | |
| 555 | static void RoadVehCrash(RoadVehicle *v) |
| 556 | { |
| 557 | uint victims = v->Crash(); |
| 558 | |
| 559 | AI::NewEvent(v->owner, new ScriptEventVehicleCrashed(v->index, v->tile, ScriptEventVehicleCrashed::CRASH_RV_LEVEL_CROSSING, victims, v->owner)); |
| 560 | Game::NewEvent(new ScriptEventVehicleCrashed(v->index, v->tile, ScriptEventVehicleCrashed::CRASH_RV_LEVEL_CROSSING, victims, v->owner)); |
| 561 | |
| 562 | EncodedString headline = (victims == 1) |
| 563 | ? GetEncodedString(STR_NEWS_ROAD_VEHICLE_CRASH_DRIVER) |
| 564 | : GetEncodedString(STR_NEWS_ROAD_VEHICLE_CRASH, victims); |
| 565 | NewsType newstype = v->owner == _local_company ? NewsType::Accident : NewsType::AccidentOther; |
| 566 | |
| 567 | AddTileNewsItem(std::move(headline), newstype, v->tile); |
| 568 | |
| 569 | ModifyStationRatingAround(v->tile, v->owner, -160, 22); |
| 570 | if (_settings_client.sound.disaster) SndPlayVehicleFx(SND_12_EXPLOSION, v); |
| 571 | } |
| 572 | |
| 573 | static bool RoadVehCheckTrainCrash(RoadVehicle *v) |
| 574 | { |
no test coverage detected