From: DeaDDooMER Date: Fri, 10 Apr 2020 05:21:15 +0000 (+0400) Subject: menu: fix cheats X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=555a6c929ea8739502282844e6253b3326cb6e2f;p=flatwaifu.git menu: fix cheats --- diff --git a/src/menu.c b/src/menu.c index 629f0c8..e80e436 100644 --- a/src/menu.c +++ b/src/menu.c @@ -567,10 +567,16 @@ void GM_key (int key, int down) { if (down) { lastkey = key; if (!_2pl || cheat) { - for (i = 0; i < 31; ++i) { + for (i = 0; i < 31; i++) { cbuf[i] = cbuf[i + 1]; } - //cbuf[31] = get_keychar(key); + if (key >= KEY_0 && key <= KEY_9) { + cbuf[31] = key - KEY_0 + '0'; + } else if (key >= KEY_A && key <= KEY_Z) { + cbuf[31] = key - KEY_A + 'A'; + } else { + cbuf[31] = 0; + } } } }