| 76 | } |
| 77 | |
| 78 | static void loc_4BED04() |
| 79 | { |
| 80 | if (!SceneManager::isDriverCheatEnabled()) |
| 81 | { |
| 82 | return; |
| 83 | // Only works when DRIVER mode is active |
| 84 | } |
| 85 | |
| 86 | for (auto i = (int32_t)WindowManager::count() - 1; i >= 0; i--) |
| 87 | { |
| 88 | auto w = WindowManager::get(i); |
| 89 | |
| 90 | if (w->type != WindowType::vehicle) |
| 91 | { |
| 92 | continue; |
| 93 | } |
| 94 | |
| 95 | auto t = EntityManager::get<Vehicles::VehicleBase>(EntityId(w->number)); |
| 96 | if (t == nullptr) |
| 97 | { |
| 98 | continue; |
| 99 | } |
| 100 | |
| 101 | if (t->owner != CompanyManager::getControllingId()) |
| 102 | { |
| 103 | continue; |
| 104 | } |
| 105 | |
| 106 | if (t->getTransportMode() != TransportMode::rail) |
| 107 | { |
| 108 | continue; |
| 109 | } |
| 110 | |
| 111 | GameCommands::VehicleApplyShuntCheatArgs args; |
| 112 | args.head = EntityId(w->number); |
| 113 | GameCommands::doCommand(args, GameCommands::Flags::apply); |
| 114 | Audio::playSound(Audio::SoundId::clickPress, Audio::ChannelId::ui, Ui::width() / 2); |
| 115 | |
| 116 | return; |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | static void loc_4BED79() |
| 121 | { |
nothing calls this directly
no test coverage detected