MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / loc_4BED04

Function loc_4BED04

src/OpenLoco/src/Input/Keyboard.cpp:78–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 9

isDriverCheatEnabledFunction · 0.85
countFunction · 0.85
EntityIdEnum · 0.85
getControllingIdFunction · 0.85
playSoundFunction · 0.85
widthFunction · 0.85
getTransportModeMethod · 0.80
getFunction · 0.50
doCommandFunction · 0.50

Tested by

no test coverage detected