]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Viewmodels: fix muzzleflashes
authorTimePath <andrew.hardaker1995@gmail.com>
Mon, 30 Nov 2015 05:52:40 +0000 (16:52 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Mon, 30 Nov 2015 05:52:40 +0000 (16:52 +1100)
qcsrc/common/weapons/all.qc
qcsrc/server/weapons/weaponsystem.qc

index d95bf12606e6b8dcc0875f3a86563b73037e35b1..e9d46e575b2a79d4707948cd2a566abcb84864e7 100644 (file)
@@ -590,7 +590,7 @@ void wframe_send(entity actor, entity weaponentity, vector a, bool restartanim)
        WriteByte(channel, restartanim);
        WriteByte(channel, weaponentity.state);
        WriteFloat(channel, weaponentity.weapon_nextthink);
-       WriteByte(channel, weaponentity.alpha * 255);
+       WriteByte(channel, weaponentity.m_alpha * 255);
        Weapon w = Weapons_from(actor.weapon);
        switch (weaponentity.state)
        {
index d8706b26e7993dd4c81f4aba88187a3b9d068329..7e10c8a60bd6bed192533096ca1a45cae6649b4d 100644 (file)
@@ -59,6 +59,7 @@ vector CL_Weapon_GetShotOrg(int wpn)
 }
 
 ..entity weaponentity_fld;
+.float m_alpha;
 
 void CL_Weaponentity_Think()
 {
@@ -92,13 +93,17 @@ void CL_Weaponentity_Think()
                CL_WeaponEntity_SetModel(this, this.owner.weaponname);
        }
 
-       this.effects = EF_NODRAW;  // TODO: don't render this entity at all
+       this.alpha = -1;  // TODO: don't render this entity at all
 
-       if (this.owner.alpha == default_player_alpha) this.alpha = default_weapon_alpha;
-       else if (this.owner.alpha != 0) this.alpha = this.owner.alpha;
-       else this.alpha = 1;
+       if (this.owner.alpha == default_player_alpha) this.m_alpha = default_weapon_alpha;
+       else if (this.owner.alpha != 0) this.m_alpha = this.owner.alpha;
+       else this.m_alpha  = 1;
 
-       if (this.weaponchild) this.weaponchild.effects = this.effects;
+       if (this.weaponchild)
+       {
+               this.weaponchild.alpha = this.alpha;
+               this.weaponchild.effects = this.effects;
+       }
 }
 
 void CL_ExteriorWeaponentity_Think()