diff --git a/src/d_iwad.cpp b/src/d_iwad.cpp index edcb89616..2b12f6c5c 100644 --- a/src/d_iwad.cpp +++ b/src/d_iwad.cpp @@ -129,6 +129,10 @@ void FIWadManager::ParseIWadInfo(const char *fn, const char *data, int datasize, sc.MustGetString(); iwad->MapInfo = sc.String; } + else if (sc.Compare("NoKeyboardCheats")) + { + iwad->nokeyboardcheats = true; + } else if (sc.Compare("Compatibility")) { sc.MustGetStringName("="); diff --git a/src/d_main.cpp b/src/d_main.cpp index 7bc1fce02..de6e80ceb 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -2441,6 +2441,7 @@ void D_DoomMain (void) const FIWADInfo *iwad_info = iwad_man->FindIWAD(allwads, iwad, basewad, optionalwad); gameinfo.gametype = iwad_info->gametype; gameinfo.flags = iwad_info->flags; + gameinfo.nokeyboardcheats = iwad_info->nokeyboardcheats; gameinfo.ConfigName = iwad_info->Configname; lastIWAD = iwad; diff --git a/src/d_main.h b/src/d_main.h index 04bf6cffd..386c33eea 100644 --- a/src/d_main.h +++ b/src/d_main.h @@ -107,6 +107,7 @@ struct FIWADInfo EGameType gametype = GAME_Doom; // which game are we playing? int StartupType = FStartupInfo::DefaultStartup; // alternate startup type FString MapInfo; // Base mapinfo to load + bool nokeyboardcheats = false; // disable keyboard cheats TArray Load; // Wads to be loaded with this one. TArray Lumps; // Lump names for identification int flags = 0; diff --git a/src/gi.h b/src/gi.h index 774474e53..2f351f583 100644 --- a/src/gi.h +++ b/src/gi.h @@ -112,6 +112,7 @@ struct gameinfo_t FString ConfigName; FString TitlePage; + bool nokeyboardcheats; bool drawreadthis; bool noloopfinalemusic; bool intermissioncounter; diff --git a/src/st_stuff.cpp b/src/st_stuff.cpp index f658d00c4..89147d83b 100644 --- a/src/st_stuff.cpp +++ b/src/st_stuff.cpp @@ -309,7 +309,7 @@ bool ST_Responder (event_t *ev) { bool eat = false; - if (nocheats || !!cl_blockcheats) + if (nocheats || !!cl_blockcheats || (gameinfo.nokeyboardcheats && !allcheats)) { return false; }