From: Mario Date: Fri, 2 Sep 2016 13:41:34 +0000 (+1000) Subject: Make wr_glow available to server, fixes third person weapon model glow X-Git-Tag: xonotic-v0.8.2~623 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d83048beb2757de1bea7290aa469ef9dc2fbdea7;p=xonotic%2Fxonotic-data.pk3dir.git Make wr_glow available to server, fixes third person weapon model glow --- diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index cd156e65e..c375ccaa4 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -294,7 +294,7 @@ void viewmodel_draw(entity this) wasinvehicle = invehicle; Weapon wep = activeweapon; int c = entcs_GetClientColors(current_player); - vector g = weaponentity_glowmod(wep, c); + vector g = weaponentity_glowmod(wep, NULL, 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 32b03a16b..9570e8c56 100644 --- a/qcsrc/common/weapons/all.qh +++ b/qcsrc/common/weapons/all.qh @@ -326,10 +326,10 @@ STATIC_INIT(register_weapons_done) .entity weaponchild; .entity exteriorweaponentity; -vector weaponentity_glowmod(Weapon wep, int c) +vector weaponentity_glowmod(Weapon wep, entity actor, int c) { vector g; - if (!(g = wep.wr_glow(wep))) g = colormapPaletteColor(c & 0x0F, true) * 2; + if (!(g = wep.wr_glow(wep, actor))) g = colormapPaletteColor(c & 0x0F, true) * 2; return g; } diff --git a/qcsrc/common/weapons/weapon.qh b/qcsrc/common/weapons/weapon.qh index 7b2f4b5b7..d16d733d5 100644 --- a/qcsrc/common/weapons/weapon.qh +++ b/qcsrc/common/weapons/weapon.qh @@ -118,7 +118,7 @@ CLASS(Weapon, Object) return false; } /** (CLIENT) weapon specific glow */ - METHOD(Weapon, wr_glow, vector(Weapon this)) { return '0 0 0'; } + METHOD(Weapon, wr_glow, vector(Weapon this, entity actor)) { return '0 0 0'; } /** (SERVER) the weapon is dropped */ METHOD(Weapon, wr_drop, void(Weapon this, entity actor)) {} /** (SERVER) a weapon is picked up */ diff --git a/qcsrc/common/weapons/weapon/vortex.qc b/qcsrc/common/weapons/weapon/vortex.qc index 3e2c1a094..bf3ce8185 100644 --- a/qcsrc/common/weapons/weapon/vortex.qc +++ b/qcsrc/common/weapons/weapon/vortex.qc @@ -69,7 +69,7 @@ REGISTER_WEAPON(VORTEX, vortex, NEW(Vortex)); REGISTER_STAT(WEP_CVAR_vortex_charge, bool, WEP_CVAR(vortex, charge)) REGISTER_STAT(WEP_CVAR_vortex_charge_animlimit, float, WEP_CVAR(vortex, charge_animlimit)) -#if defined(CSQC) +#if defined(GAMEQC) float autocvar_g_weapon_charge_colormod_red_full; float autocvar_g_weapon_charge_colormod_red_half; float autocvar_g_weapon_charge_colormod_green_full; @@ -78,11 +78,11 @@ float autocvar_g_weapon_charge_colormod_blue_half; float autocvar_g_weapon_charge_colormod_green_half; float autocvar_g_weapon_charge_colormod_hdrmultiplier; -METHOD(Vortex, wr_glow, vector(Vortex this)) +METHOD(Vortex, wr_glow, vector(Vortex this, entity actor)) { - if (!STAT(WEP_CVAR_vortex_charge)) return '0 0 0'; - float charge = STAT(VORTEX_CHARGE); - float animlimit = STAT(WEP_CVAR_vortex_charge_animlimit); + if (!STAT(WEP_CVAR_vortex_charge, actor)) return '0 0 0'; + float charge = STAT(VORTEX_CHARGE, actor); + float animlimit = STAT(WEP_CVAR_vortex_charge_animlimit, actor); vector g; g.x = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_half * min(1, charge / animlimit); g.y = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_half * min(1, charge / animlimit); diff --git a/qcsrc/server/weapons/throwing.qc b/qcsrc/server/weapons/throwing.qc index c06b90ec2..bd69e3324 100644 --- a/qcsrc/server/weapons/throwing.qc +++ b/qcsrc/server/weapons/throwing.qc @@ -45,7 +45,7 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto wep.owner = wep.enemy = own; wep.flags |= FL_TOSSED; wep.colormap = own.colormap; - wep.glowmod = weaponentity_glowmod(info, own.clientcolors); + wep.glowmod = weaponentity_glowmod(info, own, own.clientcolors); W_DropEvent(wr_drop,own,wpn,wep); diff --git a/qcsrc/server/weapons/weaponsystem.qc b/qcsrc/server/weapons/weaponsystem.qc index 2a6cd03a4..451c50ec1 100644 --- a/qcsrc/server/weapons/weaponsystem.qc +++ b/qcsrc/server/weapons/weaponsystem.qc @@ -150,7 +150,7 @@ void CL_ExteriorWeaponentity_Think(entity this) else this.alpha = 1; Weapon wep = PS(this.owner).m_weapon; - if (wep) this.glowmod = weaponentity_glowmod(wep, this.owner.clientcolors); + if (wep) this.glowmod = weaponentity_glowmod(wep, this.owner, this.owner.clientcolors); this.colormap = this.owner.colormap; CSQCMODEL_AUTOUPDATE(this);