From: TimePath Date: Mon, 30 Nov 2015 05:52:40 +0000 (+1100) Subject: Viewmodels: fix muzzleflashes X-Git-Tag: xonotic-v0.8.2~1601^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7c944977aad6cf69b7f1d611f5b06e50d3652848;p=xonotic%2Fxonotic-data.pk3dir.git Viewmodels: fix muzzleflashes --- diff --git a/qcsrc/common/weapons/all.qc b/qcsrc/common/weapons/all.qc index d95bf1260..e9d46e575 100644 --- a/qcsrc/common/weapons/all.qc +++ b/qcsrc/common/weapons/all.qc @@ -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) { diff --git a/qcsrc/server/weapons/weaponsystem.qc b/qcsrc/server/weapons/weaponsystem.qc index d8706b26e..7e10c8a60 100644 --- a/qcsrc/server/weapons/weaponsystem.qc +++ b/qcsrc/server/weapons/weaponsystem.qc @@ -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()