Engine: flip order of checks

Check for cvar or state first before checking the current thread. The cvar/state check is slightly cheaper.
This commit is contained in:
Kawe Mazidjatari 2024-04-01 01:06:32 +02:00
parent 728038b9b1
commit 3c5a1a1203
2 changed files with 2 additions and 2 deletions

View File

@ -562,7 +562,7 @@ void Cmd_Exec_f(const CCommand& args)
// Prevent users from running neo strafe commands and other quick hacks. // Prevent users from running neo strafe commands and other quick hacks.
// TODO: when reBar becomes a thing, we should verify this function and // TODO: when reBar becomes a thing, we should verify this function and
// flag users that patch them out. // flag users that patch them out.
if (!ThreadInServerFrameThread() && g_pClientState->IsActive()) if (g_pClientState->IsActive() && !ThreadInServerFrameThread())
{ {
const int execQuota = sv_quota_scriptExecsPerSecond.GetInt(); const int execQuota = sv_quota_scriptExecsPerSecond.GetInt();

View File

@ -372,7 +372,7 @@ void CNetChan::_Shutdown(CNetChan* pChan, const char* szReason, uint8_t bBadRep,
bool CNetChan::_ProcessMessages(CNetChan* pChan, bf_read* pBuf) bool CNetChan::_ProcessMessages(CNetChan* pChan, bf_read* pBuf)
{ {
#ifndef CLIENT_DLL #ifndef CLIENT_DLL
if (!ThreadInServerFrameThread() || !net_processTimeBudget.GetInt()) if (!net_processTimeBudget.GetInt() || !ThreadInServerFrameThread())
return pChan->ProcessMessages(pBuf); return pChan->ProcessMessages(pBuf);
const double flStartTime = Plat_FloatTime(); const double flStartTime = Plat_FloatTime();