Skip to content

Commit 6342fc2

Browse files
committed
Removed cache of cvar sv_cheats ValveSoftware/halflife#2511
1 parent 01e6889 commit 6342fc2

5 files changed

Lines changed: 3 additions & 7 deletions

File tree

regamedll/dlls/client.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3298,7 +3298,7 @@ void EXT_FUNC InternalCommand(edict_t *pEntity, const char *pcmd, const char *pa
32983298
else if (FStrEq(pcmd, "fov"))
32993299
{
33003300
#if 0
3301-
if (g_flWeaponCheat && CMD_ARGC() > 1)
3301+
if (CVAR_GET_FLOAT("sv_cheats") != 0.0f && CMD_ARGC() > 1)
33023302
GetClassPtr<CCSPlayer>((CBasePlayer *)pev)->m_iFOV = Q_atoi(CMD_ARGV(1));
33033303
else
33043304
CLIENT_PRINTF(pEntity, print_console, UTIL_VarArgs("\"fov\" is \"%d\"\n", int(GetClassPtr<CCSPlayer>((CBasePlayer *)pev)->m_iFOV)));

regamedll/dlls/multiplay_gamerules.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3243,7 +3243,7 @@ void CHalfLifeMultiplay::InitHUD(CBasePlayer *pl)
32433243

32443244
UpdateGameMode(pl);
32453245

3246-
if (!g_flWeaponCheat)
3246+
if (!CVAR_GET_FLOAT("sv_cheats"))
32473247
{
32483248
MESSAGE_BEGIN(MSG_ONE, gmsgViewMode, nullptr, pl->edict());
32493249
MESSAGE_END();

regamedll/dlls/player.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6060,7 +6060,7 @@ void EXT_FUNC CBasePlayer::__API_HOOK(ImpulseCommands)()
60606060

60616061
void CBasePlayer::CheatImpulseCommands(int iImpulse)
60626062
{
6063-
if (!g_flWeaponCheat)
6063+
if (!CVAR_GET_FLOAT("sv_cheats"))
60646064
return;
60656065

60666066
CBaseEntity *pEntity;

regamedll/dlls/world.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
edict_t *g_pBodyQueueHead;
44
CGlobalState gGlobalState;
5-
float g_flWeaponCheat;
65

76
DLL_DECALLIST gDecals[] =
87
{
@@ -216,7 +215,6 @@ void CWorld::Spawn()
216215
EmptyEntityHashTable();
217216
Precache();
218217

219-
g_flWeaponCheat = CVAR_GET_FLOAT("sv_cheats");
220218
g_szMapBriefingText[0] = '\0';
221219
Q_sprintf(szMapBriefingFile, "maps/%s.txt", STRING(gpGlobals->mapname));
222220

@@ -251,7 +249,6 @@ void CWorld::Spawn()
251249
EmptyEntityHashTable();
252250
Precache();
253251

254-
g_flWeaponCheat = CVAR_GET_FLOAT("sv_cheats");
255252
g_szMapBriefingText[0] = '\0';
256253

257254
int flength = 0;

regamedll/dlls/world.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,4 @@ class CWorld: public CBaseEntity {
4343
void CopyToBodyQue(entvars_t *pev);
4444
void ClearBodyQue();
4545

46-
extern float g_flWeaponCheat;
4746
extern char g_szMapBriefingText[512];

0 commit comments

Comments
 (0)