]> 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 203fbcc76c0c6cc410d2faab61a41f7c513f9c72..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,10 +1564,6 @@ 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
-
        ReplicateVars(false);
        if (ReplicateVars_NOT_SENDING())
                ReplicateVars_DELAY(0.8 + random() * 0.4); // no need to check cvars every frame