From a4b6a8f0935fd527be0c2bce82aea1aa77281966 Mon Sep 17 00:00:00 2001 From: 3saster <43163391+3saster@users.noreply.github.com> Date: Tue, 12 Nov 2019 04:29:16 -0800 Subject: [PATCH] Added 'nocheats' CVAR (#969) This CVAR disables all classic cheats (i.e. keyboard cheats). This prevents keypresses from being eaten due to attempting to read cheats --- src/st_stuff.cpp | 7 ++++++- wadsrc/static/menudef.txt | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/st_stuff.cpp b/src/st_stuff.cpp index ffa79fe01b..99f180bd7f 100644 --- a/src/st_stuff.cpp +++ b/src/st_stuff.cpp @@ -300,6 +300,7 @@ static cheatseq_t SpecialCheats[] = CVAR(Bool, allcheats, false, CVAR_ARCHIVE) +CVAR(Bool, nocheats, false, CVAR_ARCHIVE) // Respond to keyboard input events, intercept cheats. // [RH] Cheats eat the last keypress used to trigger them @@ -307,7 +308,11 @@ bool ST_Responder (event_t *ev) { bool eat = false; - if (!allcheats) + if (nocheats) + { + return false; + } + else if (!allcheats) { cheatseq_t *cheats; int numcheats; diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index a53abad8d9..fa46b7307b 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -1187,6 +1187,7 @@ OptionMenu "MiscOptions" protected } Option "$MISCMNU_QUERYIWAD", "queryiwad", "OnOff" StaticText " " + Option "$MISCMNU_NOCHEATS", "nocheats", "OnOff" Option "$MISCMNU_ALLCHEATS", "allcheats", "OnOff" Option "$MISCMNU_ENABLEAUTOSAVES", "disableautosave", "Autosave" Option "$MISCMNU_SAVELOADCONFIRMATION", "saveloadconfirmation", "OnOff"