]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/client/View.qc
Add crosshair ring setting to menu
[voretournament/voretournament.git] / data / qcsrc / client / View.qc
index bdfb160ebfc8de14575b4bda2896dd523fe24d46..ca0fa126fb8f1583b4fcba4a740d096e5969f598 100644 (file)
@@ -1062,13 +1062,13 @@ void CSQC_UpdateView(float w, float h)
                                wcross_name_alpha_goal_prev = f;\r
 \r
                                // ring around crosshair representing bullets left in weapon clip\r
+                               a = cvar("crosshair_ring_alpha");\r
                                weapon_clipload = getstati(STAT_WEAPON_CLIPLOAD);\r
-                               if (weapon_clipload)\r
+                               if (weapon_clipload && a)\r
                                {\r
-                                       weapon_clipsize = getstati(STAT_WEAPON_CLIPSIZE);\r
                                        f = bound(0, weapon_clipload / weapon_clipsize, 1);\r
                                        ring_scale = cvar("crosshair_ring_size");\r
-                                       a = cvar("crosshair_ring_alpha");\r
+                                       weapon_clipsize = getstati(STAT_WEAPON_CLIPSIZE);\r
                                        DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring.tga", f, wcross_color, wcross_alpha * a, DRAWFLAG_ADDITIVE);\r
                                }\r
                        }\r