]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Tweak the cl_deathglow effect to end with a min glow color factor (default value...
authorterencehill <piuntn@gmail.com>
Tue, 19 May 2020 21:38:46 +0000 (23:38 +0200)
committerterencehill <piuntn@gmail.com>
Tue, 19 May 2020 21:38:46 +0000 (23:38 +0200)
qcsrc/client/autocvars.qh
qcsrc/client/csqcmodel_hooks.qc
xonotic-client.cfg

index 4c6696cde139325c341095c9f5a612aee0850d60..90bf6fb91ffa0cccbb9ef81320af6047ed59e7ba 100644 (file)
@@ -446,6 +446,7 @@ int autocvar__cl_color;
 int autocvar__cl_playerskin;
 string autocvar__cl_playermodel;
 float autocvar_cl_deathglow;
+float autocvar_cl_deathglow_min = 0.5;
 bool autocvar_developer_csqcentities;
 float autocvar_cl_jetpack_attenuation = 2;
 bool autocvar_cl_showspectators;
index 1272758f76cee3de642322d9ce6ffb2419660e7a..7835463ae75d2db430e8f89db9e073dd57c63435 100644 (file)
@@ -296,12 +296,14 @@ void CSQCPlayer_ModelAppearance_Apply(entity this, bool islocalplayer)
                {
                        // Fade out to black now...
                        if(this.old_glowmod == '0 0 0') { this.old_glowmod = this.glowmod; }
-                       this.colormap = 0;
 
-                       this.glowmod = this.old_glowmod * bound(0, 1 - (time - this.death_time) / autocvar_cl_deathglow, 1);
-                       this.glowmod_x = max(this.glowmod.x, 0.0001);
-                       this.glowmod_y = max(this.glowmod.y, 0.0001);
-                       this.glowmod_z = max(this.glowmod.z, 0.0001);
+                       float min_factor = bound(0, autocvar_cl_deathglow_min, 1);
+                       if(this.colormap > 0)
+                               min_factor /= 2;
+                       float glow_fade = bound(0, 1 - (time - this.death_time) / autocvar_cl_deathglow, 1);
+                       this.glowmod *= (min_factor + glow_fade * (1 - min_factor));
+                       if (this.glowmod == '0 0 0')
+                               this.glowmod.x = 0.000001;
                }
                else if(this.old_glowmod != '0 0 0') { this.old_glowmod = '0 0 0'; }
        }
index f1335c9d29b185978c78baa09d773f5f74dd1043..389da6f74cb35b5340e0644530f2ce2291da9bcd 100644 (file)
@@ -228,7 +228,8 @@ seta cl_damageeffect_lifetime 0.1 "how much a damage effect lasts, based on dama
 seta cl_damageeffect_lifetime_min 3 "minimum lifetime a damage effect may have"
 seta cl_damageeffect_lifetime_max 6 "maximum lifetime a damage effect may have"
 
-set cl_deathglow 0.8 "number of seconds during which dead bodies glow out"
+set cl_deathglow 2 "number of seconds during which dead bodies glow out"
+set cl_deathglow_min 0.5 "glow out up to this glow factor"
 
 cl_movement 1
 cl_movement_track_canjump 0