]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/view.qc
Limit sendcvar calls to one per frame
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / view.qc
index 60ae3f18a2b355592671f31b29179fe8c51fa9fb..ac4d13a6e906d46a292864674ca2ba9bb5255207 100644 (file)
@@ -601,7 +601,7 @@ float TrueAimCheck(entity wepent)
 {
        if(wepent.activeweapon.spawnflags & WEP_FLAG_NOTRUEAIM)
                return SHOTTYPE_HITWORLD;
-       
+
        float nudge = 1; // added to traceline target and subtracted from result TOOD(divVerent): do we still need this? Doesn't the engine do this now for us?
        vector vecs, trueaimpoint, w_shotorg;
        vector mi, ma, dv;
@@ -1562,6 +1562,15 @@ void CSQC_UpdateView(entity this, float w, float h)
 
        lasthud = hud;
 
+       // TODO maybe don't send cvar values until the menu is open
+       // TODO remove CheckSendCvars from menu code (it seems broken anyway)
+       // TODO remove references to sendcvar from cvar descriptions
+       // TODO stop server from requesting cvar values to the client on connection as it's no longer necessary
+
+       ReplicateVars(false);
+       if (ReplicateVars_NOT_SENDING())
+               ReplicateVars_DELAY(0.8 + random() * 0.4); // no need to check cvars every frame
+
        HUD_Scale_Disable();
 
        if(autocvar__hud_showbinds_reload) // menu can set this one