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 drfrag
parent 3c030527af
commit 787f06d7f3
5 changed files with 8 additions and 1 deletions

View file

@ -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("=");

View file

@ -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;

View file

@ -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<FString> Load; // Wads to be loaded with this one.
TArray<FString> Lumps; // Lump names for identification
int flags = 0;

View file

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

View file

@ -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;
}