From: Mircea Kitsune Date: Wed, 14 Jul 2010 14:29:55 +0000 (+0300) Subject: Death unglow effect. When a player dies, their glow slowly fades away to black. Nice... X-Git-Tag: xonotic-v0.1.0preview~434^2~5 X-Git-Url: https://de.git.xonotic.org/?a=commitdiff_plain;h=6a792c1475a18b96fe026832bbe86a001e6ba4d7;p=xonotic%2Fxonotic-data.pk3dir.git Death unglow effect. When a player dies, their glow slowly fades away to black. Nice for eye candy and can be useful to identify a dead player more easily. --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 19fe9fef5..f9747406f 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -849,6 +849,8 @@ set g_bloodloss 0 "amount of health below which blood loss occurs" set g_footsteps 0 "serverside footstep sounds" +set g_deathglow 0.05 "the glow of a player slowly decreases to black after they die" + // effects r_picmipsprites 0 // Xonotic uses sprites that should never be picmipped (team mate, typing, waypoints) r_mipsprites 1 diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 73c9169e5..8403f3dc7 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -2599,7 +2599,23 @@ void PlayerPreThink (void) if(frametime) { - self.glowmod = colormapPaletteColor(self.clientcolors & 0x0F, TRUE) * 2; + if(self.health <= 0 && cvar("g_deathglow")) + { + if(self.glowmod_x > 0) + self.glowmod_x -= cvar("g_deathglow"); + else + self.glowmod_x = 0; + if(self.glowmod_y > 0) + self.glowmod_y -= cvar("g_deathglow"); + else + self.glowmod_y = 0; + if(self.glowmod_z > 0) + self.glowmod_z -= cvar("g_deathglow"); + else + self.glowmod_z = 0; + } + else + self.glowmod = colormapPaletteColor(self.clientcolors & 0x0F, TRUE) * 2; player_powerups(); }