]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/view.qc
Update weapon skin with CSQC
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / view.qc
index 7c3c1068b1dff2a6a0d096405cdc7d531c307552..744c54792b6cb7d2e1f3c26f9566a9fb31e71d4c 100644 (file)
@@ -291,6 +291,7 @@ void viewmodel_draw(entity this)
                return;
        int mask = (intermission || (STAT(HEALTH) <= 0) || autocvar_chase_active) ? 0 : MASK_NORMAL;
        float a = ((autocvar_cl_viewmodel_alpha) ? bound(-1, autocvar_cl_viewmodel_alpha, this.m_alpha) : this.m_alpha);
+       int wepskin = this.m_skin;
        bool invehicle = player_localentnum > maxclients;
        if (invehicle) a = -1;
        Weapon wep = this.activeweapon;
@@ -304,6 +305,7 @@ void viewmodel_draw(entity this)
        {
                e.drawmask = mask;
                e.alpha = a;
+               e.skin = wepskin;
                e.colormap = 256 + c;  // colormap == 0 is black, c == 0 is white
                e.glowmod = g;
                e.csqcmodel_effects = fx;
@@ -1562,6 +1564,10 @@ void CSQC_UpdateView(entity this, float w, float h)
 
        lasthud = hud;
 
+       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