Skip to content

Commit

Permalink
Remove cheat flag from report_entities & endround
Browse files Browse the repository at this point in the history
  • Loading branch information
Vauff committed Nov 14, 2024
1 parent 95cd55c commit 89d77df
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/cvars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
static uint64 g_iFlagsToRemove = (FCVAR_HIDDEN | FCVAR_DEVELOPMENTONLY | FCVAR_MISSING0 | FCVAR_MISSING1 | FCVAR_MISSING2 | FCVAR_MISSING3);

static constexpr const char *pUnCheatCvars[] = { "bot_stop", "bot_freeze", "bot_zombie" };
static constexpr const char* pUnCheatCmds[] = { "report_entities", "endround" };

void UnlockConVars()
{
Expand Down Expand Up @@ -81,11 +82,20 @@ void UnlockConCommands()

hConCommandHandle.Set(hConCommandHandle.Get() + 1);

if (!pConCommand || pConCommand == pInvalidCommand || !(pConCommand->GetFlags() & g_iFlagsToRemove))
if (!pConCommand || pConCommand == pInvalidCommand)
continue;

pConCommand->RemoveFlags(g_iFlagsToRemove);
iUnhiddenConCommands++;
for (int i = 0; i < sizeof(pUnCheatCmds) / sizeof(*pUnCheatCmds); i++)
{
if (!V_strcmp(pConCommand->GetName(), pUnCheatCmds[i]))
pConCommand->RemoveFlags(FCVAR_CHEAT);
}

if (pConCommand->GetFlags() & g_iFlagsToRemove)
{
pConCommand->RemoveFlags(g_iFlagsToRemove);
iUnhiddenConCommands++;
}
} while (pConCommand && pConCommand != pInvalidCommand);

Message("Removed hidden flags from %d commands\n", iUnhiddenConCommands);
Expand Down

0 comments on commit 89d77df

Please sign in to comment.