From: terencehill <piuntn@gmail.com>
Date: Sat, 12 Dec 2020 17:37:41 +0000 (+0100)
Subject: Don't let the engine increase player's glowmod
X-Git-Tag: xonotic-v0.8.5~7^2~13^2
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b4f8ba4d65739357ef527bf31861002e23a254cb;p=xonotic%2Fxonotic-data.pk3dir.git

Don't let the engine increase player's glowmod
---

diff --git a/qcsrc/client/csqcmodel_hooks.qc b/qcsrc/client/csqcmodel_hooks.qc
index 70b5b59b53..21b3c7780e 100644
--- a/qcsrc/client/csqcmodel_hooks.qc
+++ b/qcsrc/client/csqcmodel_hooks.qc
@@ -317,6 +317,10 @@ void CSQCPlayer_ModelAppearance_Apply(entity this, bool islocalplayer)
 		}
 	}
 
+	// don't let the engine increase player's glowmod
+	if (autocvar_r_hdr_glowintensity > 1)
+		this.glowmod /= autocvar_r_hdr_glowintensity;
+
 	//printf("CSQCPlayer_ModelAppearance_Apply(): state = %s, colormap = %f, glowmod = %s\n", (this.csqcmodel_isdead ? "DEAD" : "ALIVE"), this.colormap, vtos(this.glowmod));
 }
 
diff --git a/qcsrc/client/csqcmodel_hooks.qh b/qcsrc/client/csqcmodel_hooks.qh
index dd10112d73..3f2b5192f6 100644
--- a/qcsrc/client/csqcmodel_hooks.qh
+++ b/qcsrc/client/csqcmodel_hooks.qh
@@ -16,6 +16,7 @@ string autocvar__cl_playermodel;
 float autocvar_cl_deathglow;
 float autocvar_cl_deathglow_min = 0.5;
 float autocvar_cl_jetpack_attenuation = 2;
+float autocvar_r_hdr_glowintensity;
 
 // FEATURE: EF_NODRAW workalike
 const int EF_BRIGHTFIELD       = BIT(0);