From: terencehill Date: Mon, 1 Jun 2020 13:19:38 +0000 (+0200) Subject: Don't randomize respawn ghost time (g_respawn_ghosts_time replaces g_respawn_ghosts_m... X-Git-Tag: xonotic-v0.8.5~970 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2f9df777d0201ee266546e7c4fe2ae30c8e3f635;p=xonotic%2Fxonotic-data.pk3dir.git Don't randomize respawn ghost time (g_respawn_ghosts_time replaces g_respawn_ghosts_maxtime), add g_respawn_ghosts_fadetime and g_respawn_ghosts_alpha (default values unchanged) --- diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index 79989cc17..34a3efedd 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -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; diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index ddcb6f3f5..a4885f024 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -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 diff --git a/xonotic-server.cfg b/xonotic-server.cfg index 8a458d8d0..c7b63f536 100644 --- a/xonotic-server.cfg +++ b/xonotic-server.cfg @@ -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"