From: terencehill Date: Fri, 29 May 2020 20:25:54 +0000 (+0200) Subject: Fix crosshair_chase not resetting player's alpha upon death X-Git-Tag: xonotic-v0.8.5~998 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f44756b967eea3cb1fd45e4e5129abbe83ef9080;p=xonotic%2Fxonotic-data.pk3dir.git Fix crosshair_chase not resetting player's alpha upon death --- diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index f3ffebac6..7a8b5e705 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -1079,6 +1079,10 @@ LABEL(normalcolor) void HUD_Crosshair(entity this) { + // reset player's alpha here upon death since forced scoreboard prevents running the crosshair_chase code + if(autocvar_chase_active > 0 && autocvar_crosshair_chase && STAT(HEALTH) <= 0 && csqcplayer) + csqcplayer.alpha = csqcplayer.m_alpha; + float f, i, j; vector v; if(!scoreboard_active && !camera_active && intermission != 2 && !STAT(GAME_STOPPED) && @@ -1124,7 +1128,7 @@ void HUD_Crosshair(entity this) { traceline(view_origin, view_origin + max_shot_distance * view_forward, MOVE_NORMAL, NULL); float myalpha = (!csqcplayer.m_alpha) ? 1 : csqcplayer.m_alpha; - if(trace_ent == csqcplayer && STAT(HEALTH) > 0) + if(trace_ent == csqcplayer) csqcplayer.alpha = min(autocvar_crosshair_chase_playeralpha, myalpha); else csqcplayer.alpha = csqcplayer.m_alpha; @@ -1159,7 +1163,7 @@ void HUD_Crosshair(entity this) string wcross_name = ""; float wcross_scale, wcross_blur; - entity e = WEP_Null; + entity e = WEP_Null; if(autocvar_crosshair_per_weapon || (autocvar_crosshair_color_special == 1)) { entity wepent = viewmodels[0]; // TODO: unhardcode diff --git a/qcsrc/common/weapons/weapon/arc.qc b/qcsrc/common/weapons/weapon/arc.qc index ae2dbf07d..ff663e304 100644 --- a/qcsrc/common/weapons/weapon/arc.qc +++ b/qcsrc/common/weapons/weapon/arc.qc @@ -897,10 +897,7 @@ void Draw_ArcBeam(entity this) MAKE_VECTORS(myviewangle, forward, right, up); entity wepent = viewmodels[this.beam_slot]; - if(autocvar_chase_active) - this.beam_usevieworigin = 1; - else - this.beam_usevieworigin = 2; + this.beam_usevieworigin = (autocvar_chase_active) ? 1 : 2; // decide upon start position if(this.beam_usevieworigin == 2) @@ -1231,10 +1228,7 @@ NET_HANDLE(ENT_CLIENT_ARC_BEAM, bool isnew) if(ReadByte()) { - if(autocvar_chase_active) - { this.beam_usevieworigin = 1; } - else // use view origin - { this.beam_usevieworigin = 2; } + this.beam_usevieworigin = (autocvar_chase_active) ? 1 : 2; } else {