0x00462C8E
| 33 | |
| 34 | // 0x00462C8E |
| 35 | void setCollisionErrorMessage(const World::TileElement& el) |
| 36 | { |
| 37 | switch (el.type()) |
| 38 | { |
| 39 | case ElementType::surface: |
| 40 | { |
| 41 | GameCommands::setErrorText(StringIds::raise_or_lower_land_first); |
| 42 | break; |
| 43 | } |
| 44 | case ElementType::track: |
| 45 | { |
| 46 | auto* elTrack = el.as<TrackElement>(); |
| 47 | if (elTrack == nullptr) |
| 48 | { |
| 49 | return; |
| 50 | } |
| 51 | auto* trackObj = ObjectManager::get<TrackObject>(elTrack->trackObjectId()); |
| 52 | FormatArguments::common(trackObj->name); |
| 53 | |
| 54 | GameCommands::setErrorText(StringIds::string_id_in_the_way); |
| 55 | break; |
| 56 | } |
| 57 | case ElementType::station: |
| 58 | { |
| 59 | auto* elStation = el.as<StationElement>(); |
| 60 | if (elStation == nullptr) |
| 61 | { |
| 62 | return; |
| 63 | } |
| 64 | constexpr std::array<StringId, 4> kStationTypeNames = { |
| 65 | StringIds::capt_station, |
| 66 | StringIds::capt_station, |
| 67 | StringIds::capt_airport, |
| 68 | StringIds::capt_ship_port, |
| 69 | }; |
| 70 | FormatArguments::common(kStationTypeNames[enumValue(elStation->stationType())]); |
| 71 | |
| 72 | GameCommands::setErrorText(StringIds::string_id_in_the_way); |
| 73 | break; |
| 74 | } |
| 75 | |
| 76 | case ElementType::signal: |
| 77 | { |
| 78 | FormatArguments::common(StringIds::capt_signal); |
| 79 | GameCommands::setErrorText(StringIds::string_id_in_the_way); |
| 80 | break; |
| 81 | } |
| 82 | case ElementType::building: |
| 83 | { |
| 84 | auto* elBuidling = el.as<BuildingElement>(); |
| 85 | if (elBuidling == nullptr) |
| 86 | { |
| 87 | return; |
| 88 | } |
| 89 | auto* buildingObj = elBuidling->getObject(); |
| 90 | FormatArguments::common(buildingObj->name); |
| 91 | |
| 92 | GameCommands::setErrorText(StringIds::string_id_in_the_way); |
no test coverage detected