From: Mario Date: Sun, 31 May 2020 20:40:52 +0000 (+1000) Subject: If respawn ghosts are disabled, fade out the player's corpse immediately when respawning X-Git-Tag: xonotic-v0.8.5~977 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=419df0a2f15b3b849bab2c2447f99d2f4f6dce06;p=xonotic%2Fxonotic-data.pk3dir.git If respawn ghosts are disabled, fade out the player's corpse immediately when respawning --- 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);