Quote:
Originally Posted by strelomet
Nope, in original yapb, this cvars update every second, but later i remove all less used global variables, but now i notice lags, and restored this stuff Whatever thanks to podbot mm
|
Yep - You are right - just noticed some cvars were really updated not every frame, but.. every 0.5s in some sources of YapB dated 25.11.2005
Code:
void StartFrame( void )
{
static int i, index, player_index;
static float msecdel = 0, msecnum = 0;
if (g_flCvarUpdateTime < gpGlobals->time)
{
g_iBotQuota = (int)CVAR_GET_FLOAT(g_cvarBotQuota.name);
g_iMinBotSkill = (int)CVAR_GET_FLOAT(g_cvarMinBotSkill.name);
g_iMaxBotSkill = (int)CVAR_GET_FLOAT(g_cvarMaxBotSkill.name);
g_iMaxNumFollow = (int)CVAR_GET_FLOAT(g_cvarMaxNumFollow.name);
g_fTimeSoundUpdate = CVAR_GET_FLOAT(g_cvarTimeSoundUpdate.name);
g_fTimePickupUpdate = CVAR_GET_FLOAT(g_cvarTimePickupUpdate.name);
g_fTimeGrenadeUpdate = CVAR_GET_FLOAT(g_cvarTimeGrenadeUpdate.name);
g_iDebugGoalIndex = (int)CVAR_GET_FLOAT(g_cvarDebugGoalIndex.name);
g_bUseExperience = CVAR_GET_FLOAT(g_cvarUseExperience.name) > 0;
g_bAutoSaveExperience = CVAR_GET_FLOAT(g_cvarAutoSaveExperience.name) > 0;
g_bBotChat = CVAR_GET_FLOAT(g_cvarBotChat.name) > 0;
g_bBotUseRadio = CVAR_GET_FLOAT(g_cvarBotUseRadio.name) > 0;
g_bJasonMode = CVAR_GET_FLOAT(g_cvarJasonMode.name) > 0;
g_bDetailNames = CVAR_GET_FLOAT(g_cvarDetailNames.name) > 0;
g_bInstantTurns = CVAR_GET_FLOAT(g_cvarInstantTurns.name) > 0;
g_bShootThruWalls = CVAR_GET_FLOAT(g_cvarShootThruWalls.name) > 0;
g_bAllowVotes = CVAR_GET_FLOAT(g_cvarAllowVotes.name) > 0;
g_bBotSpray = CVAR_GET_FLOAT(g_cvarBotSpray.name) > 0;
g_bBotBuy = CVAR_GET_FLOAT(g_cvarBotBuy.name) > 0;
g_bBotAutoVacate = CVAR_GET_FLOAT(g_cvarBotAutoVacate.name) > 0;
g_flCvarUpdateTime = gpGlobals->time + 0.5;
}
Seems I discovered something what Whistler found few months before me. I didn't see it before. I was talking toTHE_STORM about that optimization of code (I was believing it was only my idea).