]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/wepent.qc
Send alpha as part of weapon state, rather than when firing
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / wepent.qc
index 036867888d9e96dc10c8557e51a368435a71e269..cfd846d0c5df19179be8e4a48e5caab4f49dca8c 100644 (file)
@@ -15,6 +15,7 @@ MACRO_END
 .Weapon w_m_switchingweapon;
 .Weapon w_m_weapon;
 //.float w_weapon_nextthink;
+.float w_m_alpha;
 
 // #define PROP(public, fld, set, sv, cl)
 #define WEPENT_NETPROPS(PROP) PROP(false, sv_entnum, WEPENT_SET_NORMAL, {}, {}) /* sentinel */ \
@@ -29,6 +30,10 @@ MACRO_END
     PROP(false, m_weapon, WEPENT_SET_NORMAL, \
        { WriteByte(chan, this.m_weapon.m_id); }, \
        { (viewmodels[this.m_wepent_slot]).activeweapon = Weapons_from(ReadByte()); }) \
+    \
+    PROP(false, m_alpha, WEPENT_SET_NORMAL, \
+       { WriteByte(chan, this.m_alpha * 16); }, \
+       { (viewmodels[this.m_wepent_slot]).alpha = ReadByte() / 16; }) \
     \
        /**/