]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Make wr_glow available to server, fixes third person weapon model glow
authorMario <mario@smbclan.net>
Fri, 2 Sep 2016 13:41:34 +0000 (23:41 +1000)
committerMario <mario@smbclan.net>
Fri, 2 Sep 2016 13:41:34 +0000 (23:41 +1000)
qcsrc/client/view.qc
qcsrc/common/weapons/all.qh
qcsrc/common/weapons/weapon.qh
qcsrc/common/weapons/weapon/vortex.qc
qcsrc/server/weapons/throwing.qc
qcsrc/server/weapons/weaponsystem.qc

index cd156e65ec7b3989e0afc6ce1d8a08faa4c4aa12..c375ccaa47c9aee3def6804eb33012935f1b9158 100644 (file)
@@ -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)
index 32b03a16be3605d5776bd9d630312cbbb2fac79b..9570e8c561aaac732a39ba63ae1a5d51fdbf68e9 100644 (file)
@@ -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;
 }
 
index 7b2f4b5b7a03b33073ecd0ba3c9d63e08dc1e6ce..d16d733d5989a13ea7284ae0385da9f1c1d4d9f4 100644 (file)
@@ -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 */
index 3e2c1a094e7795dd7e3f99b84ad18a7cd683cece..bf3ce8185f2f33168e3da300b5722447151d14c3 100644 (file)
@@ -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);
index c06b90ec2d98434d3940cb075b235baffb7451a2..bd69e33246d6b3dae4593e008493f0b2582d1f63 100644 (file)
@@ -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);
 
index 2a6cd03a4daec752658f6f92d6107b4ea3bdd3ab..451c50ec12f13b861254c75a3d4313fea115e0e9 100644 (file)
@@ -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);