From 419df0a2f15b3b849bab2c2447f99d2f4f6dce06 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 1 Jun 2020 06:40:52 +1000 Subject: [PATCH] If respawn ghosts are disabled, fade out the player's corpse immediately when respawning --- qcsrc/server/client.qc | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 375c368ef..ddcb6f3f5 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -1323,17 +1323,22 @@ void UpdateChatBubble(entity this) void respawn(entity this) { - if(this.alpha >= 0 && autocvar_g_respawn_ghosts) + if(this.alpha >= 0) { - this.solid = SOLID_NOT; - this.takedamage = DAMAGE_NO; - set_movetype(this, MOVETYPE_FLY); - 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; - 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) + { + this.solid = SOLID_NOT; + this.takedamage = DAMAGE_NO; + set_movetype(this, MOVETYPE_FLY); + 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; + 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); + } + else + SUB_SetFade (this, time, 1); // fade out the corpse immediately } CopyBody(this, 1); -- 2.39.2