From: TimePath Date: Sat, 9 Jan 2016 10:57:04 +0000 (+1100) Subject: legacy networking: bring glowmod back, accidentally it X-Git-Tag: xonotic-v0.8.2~1254 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b5e8b8e099d5a6b7964d3e28b96e979dff64bcde;p=xonotic%2Fxonotic-data.pk3dir.git legacy networking: bring glowmod back, accidentally it --- diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 4eab4c5c5..7288f253e 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -278,10 +278,9 @@ void viewmodel_draw(entity this) if (invehicle) a = -1; else if (wasinvehicle) a = 1; wasinvehicle = invehicle; - int c = stof(getplayerkeyvalue(current_player, "colors")); - vector g; Weapon wep = activeweapon; - if (!(g = wep.wr_glow(wep))) g = colormapPaletteColor(c & 0x0F, true) * 2; + int c = stof(getplayerkeyvalue(current_player, "colors")); + vector g = weaponentity_glowmod(wep, c); entity me = CSQCModel_server2csqc(player_localentnum - 1); int fx = ((me.csqcmodel_effects & EFMASK_CHEAP) | EF_NODEPTHTEST) diff --git a/qcsrc/common/weapons/all.qh b/qcsrc/common/weapons/all.qh index 4819f2c25..6429ff899 100644 --- a/qcsrc/common/weapons/all.qh +++ b/qcsrc/common/weapons/all.qh @@ -325,7 +325,12 @@ STATIC_INIT(register_weapons_done) .entity weaponchild; .entity exteriorweaponentity; -.vector weaponentity_glowmod; +vector weaponentity_glowmod(Weapon wep, int c) +{ + vector g; + if (!(g = wep.wr_glow(wep))) g = colormapPaletteColor(c & 0x0F, true) * 2; + return g; +} //.int weapon; // current weapon .string weaponname; // name of .weapon diff --git a/qcsrc/server/weapons/throwing.qc b/qcsrc/server/weapons/throwing.qc index e36825e48..df0f7b691 100644 --- a/qcsrc/server/weapons/throwing.qc +++ b/qcsrc/server/weapons/throwing.qc @@ -78,7 +78,7 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto weapon_defaultspawnfunc(wep, info); if(startitem_failed) return string_null; - wep.glowmod = own.weaponentity_glowmod; + wep.glowmod = weaponentity_glowmod(wep, own.clientcolors); wep.think = thrown_wep_think; wep.savenextthink = wep.nextthink; wep.nextthink = min(wep.nextthink, time + 0.5); diff --git a/qcsrc/server/weapons/weaponsystem.qc b/qcsrc/server/weapons/weaponsystem.qc index d58e19148..4972d818f 100644 --- a/qcsrc/server/weapons/weaponsystem.qc +++ b/qcsrc/server/weapons/weaponsystem.qc @@ -147,7 +147,7 @@ void CL_ExteriorWeaponentity_Think() else if (this.owner.alpha != 0) this.alpha = this.owner.alpha; else this.alpha = 1; - this.glowmod = this.owner.weaponentity_glowmod; + this.glowmod = weaponentity_glowmod(PS(this.owner).m_weapon, this.owner.clientcolors); this.colormap = this.owner.colormap; CSQCMODEL_AUTOUPDATE(this);