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

Function cheat

src/OpenLoco/src/Input/Keyboard.cpp:273–310  ·  view source on GitHub ↗

0x004BEC5B

Source from the content-addressed store, hash-verified

271
272 // 0x004BEC5B
273 static void cheat()
274 {
275 // Used to handle INSERT cheat
276 if (_keyboardState[SDL_SCANCODE_INSERT] || _keyboardState[SDL_SCANCODE_LALT] || _keyboardState[SDL_SCANCODE_RALT])
277 {
278 if (hasKeyModifier(KeyModifier::cheat))
279 {
280 return;
281 }
282 else
283 {
284 _keyModifier |= KeyModifier::cheat;
285 _cheatBuffer.clear();
286 return;
287 }
288 }
289
290 if (!hasKeyModifier(KeyModifier::cheat))
291 {
292 return;
293 }
294
295 _keyModifier = _keyModifier & (~KeyModifier::cheat);
296
297 if (SceneManager::isTitleMode())
298 {
299 return;
300 }
301
302 for (const auto& cheat : kCheats)
303 {
304 if (strcmp(_cheatBuffer.c_str(), cheat.first.c_str()) == 0)
305 {
306 cheat.second();
307 break;
308 }
309 }
310 }
311
312 // 0x004BEDA0
313 static void normalKey()

Callers 1

processKeyboardInputFunction · 0.70

Calls 3

hasKeyModifierFunction · 0.85
isTitleModeFunction · 0.85
clearMethod · 0.45

Tested by

no test coverage detected