]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Update weapon skin with CSQC
authorMario <mario@smbclan.net>
Tue, 27 Aug 2019 04:16:37 +0000 (14:16 +1000)
committerMario <mario@smbclan.net>
Tue, 27 Aug 2019 04:16:37 +0000 (14:16 +1000)
qcsrc/client/view.qc
qcsrc/common/wepent.qc
qcsrc/common/wepent.qh
qcsrc/server/weapons/weaponsystem.qc

index 7385b4c3a9ae82be08d7d96806636daa470392c5..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;
index 9193c4ef1638af9dd797acfe8e666ae9f2d2c1df..38ef3bd1f7d4c5303e5f639f5c6306711d1385ba 100644 (file)
@@ -73,6 +73,10 @@ MACRO_END
     PROP(false, clip_size, WEPENT_SET_NORMAL, \
        { WriteShort(chan, this.clip_size); }, \
        { (viewmodels[this.m_wepent_slot]).clip_size = ReadShort(); }) \
+    \
+    PROP(false, skin, WEPENT_SET_NORMAL, \
+       { WriteShort(chan, this.skin); }, \
+       { (viewmodels[this.m_wepent_slot]).m_skin = ReadShort(); }) \
     \
        /**/
 
index 556f58194f5ed5298d52f0aad3f4e6ca3f046e2a..6d7128c33ca27323d91cd6ba8685fb6ca61ac0e4 100644 (file)
@@ -37,6 +37,8 @@ REGISTER_NET_TEMP(CLIENT_WEPENT)
 
        .float m_alpha;
 
+       .int m_skin;
+
        // only for Porto
        .bool angles_held_status;
        .vector angles_held;
index b75881127a219008f56faaad9d086817d922ab4c..19ba40aa0b6ce6bc6913f0abb2a7ee99a80f5cb0 100644 (file)
@@ -163,6 +163,7 @@ void CL_ExteriorWeaponentity_Think(entity this)
     Weapon wep = this.owner.(weaponentity).m_weapon;
        if (wep) this.glowmod = weaponentity_glowmod(wep, this.owner, this.owner.clientcolors, this.owner.(weaponentity));
        this.colormap = this.owner.colormap;
+       this.skin = w_ent.skin;
 
        CSQCMODEL_AUTOUPDATE(this);
 }