]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Apply transition between black (off / discharged), red (not charged) and blue (charged)
authorLegendaryGuard <rootuser999@gmail.com>
Thu, 17 Nov 2022 08:11:23 +0000 (09:11 +0100)
committerLegendaryGuard <rootuser999@gmail.com>
Thu, 17 Nov 2022 08:11:23 +0000 (09:11 +0100)
qcsrc/common/weapons/weapon/vortex.qc

index 5f3ddfa18e9501f4b421e0b30860c64a70f71ba0..69007968d99ee308432abae5d5ae0fdb67c2a889 100644 (file)
@@ -24,10 +24,10 @@ METHOD(Vortex, wr_glow, vector(Vortex this, entity actor, entity wepent))
        g.z = f * autocvar_g_weapon_charge_colormod_blue_half;
        if (charge < animlimit)
        {
-               f = autocvar_g_weapon_charge_colormod_hdrmultiplier * min(1, charge / animlimit);
-               g.x += f * autocvar_g_weapon_charge_colormod_red_full;
-               g.y += fabs(f * autocvar_g_weapon_charge_colormod_green_full);
-               g.z += fabs(f * autocvar_g_weapon_charge_colormod_blue_full);
+        f = autocvar_g_weapon_charge_colormod_hdrmultiplier * min(1, charge / animlimit) * charge / (1 - animlimit);
+        g.x += f * autocvar_g_weapon_charge_colormod_red_full;
+        g.y += f * autocvar_g_weapon_charge_colormod_green_full;
+        g.z += f * autocvar_g_weapon_charge_colormod_blue_full;
        }
        // transition color can't be '0 0 0' as it defaults to player model glow color
        if (g == '0 0 0')