]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Don't randomize respawn ghost time (g_respawn_ghosts_time replaces g_respawn_ghosts_m...
authorterencehill <piuntn@gmail.com>
Mon, 1 Jun 2020 13:19:38 +0000 (15:19 +0200)
committerterencehill <piuntn@gmail.com>
Mon, 1 Jun 2020 13:19:38 +0000 (15:19 +0200)
qcsrc/server/autocvars.qh
qcsrc/server/client.qc
xonotic-server.cfg

index 79989cc176d1a3e70200cd3fe03f60da91458817..34a3efedd64cde0936f6676bd42791df2b8ddea7 100644 (file)
@@ -201,7 +201,9 @@ int autocvar_g_respawn_delay_large_count;
 float autocvar_g_respawn_delay_max;
 bool autocvar_g_respawn_delay_forced;
 bool autocvar_g_respawn_ghosts;
-float autocvar_g_respawn_ghosts_maxtime;
+float autocvar_g_respawn_ghosts_alpha;
+float autocvar_g_respawn_ghosts_fadetime;
+float autocvar_g_respawn_ghosts_time;
 float autocvar_g_respawn_ghosts_speed;
 int autocvar_g_respawn_waves;
 string autocvar_g_shootfromfixedorigin;
index ddcb6f3f5e4bcb7c19c987b87311ed249188b0be..a4885f024dc94456efc185a0fdefa9176cf78f59 100644 (file)
@@ -1333,9 +1333,10 @@ void respawn(entity this)
                        this.velocity = '0 0 1' * autocvar_g_respawn_ghosts_speed;
                        this.avelocity = randomvec() * autocvar_g_respawn_ghosts_speed * 3 - randomvec() * autocvar_g_respawn_ghosts_speed * 3;
                        this.effects |= CSQCMODEL_EF_RESPAWNGHOST;
+                       this.alpha = min(this.alpha, autocvar_g_respawn_ghosts_alpha);
                        Send_Effect(EFFECT_RESPAWN_GHOST, this.origin, '0 0 0', 1);
-                       if(autocvar_g_respawn_ghosts_maxtime)
-                               SUB_SetFade (this, time + autocvar_g_respawn_ghosts_maxtime / 2 + random () * (autocvar_g_respawn_ghosts_maxtime - autocvar_g_respawn_ghosts_maxtime / 2), 1.5);
+                       if(autocvar_g_respawn_ghosts_time > 0)
+                               SUB_SetFade(this, time + autocvar_g_respawn_ghosts_time, autocvar_g_respawn_ghosts_fadetime);
                }
                else
                        SUB_SetFade (this, time, 1); // fade out the corpse immediately
index 8a458d8d0673f5b079348949daea0e95995a86d1..c7b63f536cafb6cb442c89bd17d6716295c8f31b 100644 (file)
@@ -58,7 +58,9 @@ set g_teleport_maxspeed 0 "maximum speed that a player can keep when going throu
 
 set g_respawn_ghosts 1 "if 1 dead bodies become ghosts and float away when the player respawns"
 set g_respawn_ghosts_speed 5 "the speed with which respawn ghosts float and rotate"
-set g_respawn_ghosts_maxtime 6 "maximum amount of time a respawn ghost can last, minimum time is half this value. 0 disables and ghosts fade when the body would"
+set g_respawn_ghosts_time 4.5 "amount of time a respawn ghost lasts before it starts fading out. 0 disables and ghosts fade when the body would"
+set g_respawn_ghosts_fadetime 1.5 "amount of time a respawn ghost takes to fade out"
+set g_respawn_ghosts_alpha 1 "respawn ghost alpha"
 
 set sv_gibhealth 100 "Minus health a dead body must have in order to get gibbed"