From ae3d8e5ea578935e5fd18c89c44cc1c968df3fca Mon Sep 17 00:00:00 2001 From: pierow Date: Wed, 7 Jul 2021 18:02:42 -0400 Subject: [PATCH] crosshair exploit prevention --- main/source/cl_dll/hud_crosshairs.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main/source/cl_dll/hud_crosshairs.cpp b/main/source/cl_dll/hud_crosshairs.cpp index 50924cfd..18ceeb79 100644 --- a/main/source/cl_dll/hud_crosshairs.cpp +++ b/main/source/cl_dll/hud_crosshairs.cpp @@ -217,7 +217,9 @@ int CHudCrosshairs::Draw(float time) // Draw the crosshairs. if (cl_cross_thickness->value > 0.0f) { - gl.line_width(cl_cross_thickness->value); + //gl.line_width(cl_cross_thickness->value); + //clamp dot size to prevent using it as a full screen transparent mask for highlighting eneimies like with the /nvg night vision server plugin. + gl.line_width(min(cl_cross_thickness->value, ScreenHeight() * 0.3f)); float size = cl_cross_size->value; float gap = cl_cross_gap->value; @@ -276,7 +278,9 @@ int CHudCrosshairs::Draw(float time) gl.color(r, g, b, dotalpha); } - float size = cl_cross_dot_size->value; + //float size = cl_cross_dot_size->value; + //clamp dot size to prevent using it as a full screen transparent mask for highlighting eneimies like with the /nvg night vision server plugin. + float size = min(cl_cross_dot_size->value, ScreenHeight() * 0.2f); Vector2D offset = Vector2D(size / 2.0f, size / 2.0f); gl.rectangle(center - offset, center + offset);