Added 'NoKeyboardCheats' option to IWADINFO

This is useful for IWADs that do not want to use the hardcoded engine cheats. This can still be overriden with the 'allcheats' CVAR
This commit is contained in:
PaulyB 2019-11-13 03:58:27 -08:00 committed by Christoph Oelckers
parent 26dd900b3e
commit a74be69371
5 changed files with 8 additions and 1 deletions

View file

@ -128,6 +128,10 @@ void FIWadManager::ParseIWadInfo(const char *fn, const char *data, int datasize,
sc.MustGetString(); sc.MustGetString();
iwad->MapInfo = sc.String; iwad->MapInfo = sc.String;
} }
else if (sc.Compare("NoKeyboardCheats"))
{
iwad->nokeyboardcheats = true;
}
else if (sc.Compare("Compatibility")) else if (sc.Compare("Compatibility"))
{ {
sc.MustGetStringName("="); sc.MustGetStringName("=");

View file

@ -2480,6 +2480,7 @@ static int D_DoomMain_Internal (void)
if (!iwad_info) return 0; // user exited the selection popup via cancel button. if (!iwad_info) return 0; // user exited the selection popup via cancel button.
gameinfo.gametype = iwad_info->gametype; gameinfo.gametype = iwad_info->gametype;
gameinfo.flags = iwad_info->flags; gameinfo.flags = iwad_info->flags;
gameinfo.nokeyboardcheats = iwad_info->nokeyboardcheats;
gameinfo.ConfigName = iwad_info->Configname; gameinfo.ConfigName = iwad_info->Configname;
lastIWAD = iwad; lastIWAD = iwad;

View file

@ -107,6 +107,7 @@ struct FIWADInfo
EGameType gametype = GAME_Doom; // which game are we playing? EGameType gametype = GAME_Doom; // which game are we playing?
int StartupType = FStartupInfo::DefaultStartup; // alternate startup type int StartupType = FStartupInfo::DefaultStartup; // alternate startup type
FString MapInfo; // Base mapinfo to load FString MapInfo; // Base mapinfo to load
bool nokeyboardcheats = false; // disable keyboard cheats
TArray<FString> Load; // Wads to be loaded with this one. TArray<FString> Load; // Wads to be loaded with this one.
TArray<FString> Lumps; // Lump names for identification TArray<FString> Lumps; // Lump names for identification
TArray<FString> DeleteLumps; // Lumps which must be deleted from the directory. TArray<FString> DeleteLumps; // Lumps which must be deleted from the directory.

View file

@ -111,6 +111,7 @@ struct gameinfo_t
FString ConfigName; FString ConfigName;
FString TitlePage; FString TitlePage;
bool nokeyboardcheats;
bool drawreadthis; bool drawreadthis;
bool noloopfinalemusic; bool noloopfinalemusic;
bool intermissioncounter; bool intermissioncounter;

View file

@ -309,7 +309,7 @@ bool ST_Responder (event_t *ev)
{ {
bool eat = false; bool eat = false;
if (nocheats || !!cl_blockcheats) if (nocheats || !!cl_blockcheats || (gameinfo.nokeyboardcheats && !allcheats))
{ {
return false; return false;
} }