]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Invert Vortex charge color
authorLegendaryGuard <rootuser999@gmail.com>
Wed, 16 Nov 2022 21:39:58 +0000 (22:39 +0100)
committerLegendaryGuard <rootuser999@gmail.com>
Wed, 16 Nov 2022 21:39:58 +0000 (22:39 +0100)
qcsrc/common/weapons/weapon/vortex.qc

index 98762a03e13f4fe1c96a7a187348fdc069e1d81f..5f3ddfa18e9501f4b421e0b30860c64a70f71ba0 100644 (file)
@@ -22,12 +22,12 @@ METHOD(Vortex, wr_glow, vector(Vortex this, entity actor, entity wepent))
        g.x = f * autocvar_g_weapon_charge_colormod_red_half;
        g.y = f * autocvar_g_weapon_charge_colormod_green_half;
        g.z = f * autocvar_g_weapon_charge_colormod_blue_half;
-       if (charge > animlimit)
+       if (charge < animlimit)
        {
-               f = autocvar_g_weapon_charge_colormod_hdrmultiplier * (charge - animlimit) / (1 - animlimit);
+               f = autocvar_g_weapon_charge_colormod_hdrmultiplier * min(1, charge / 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;
+               g.y += fabs(f * autocvar_g_weapon_charge_colormod_green_full);
+               g.z += fabs(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')