Merge branch 'master' into mirceakitsune/universal_reload_system
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / View.qc
index 7270a9c..7fde682 100644 (file)
@@ -866,7 +866,7 @@ void CSQC_UpdateView(float w, float h)
 
                        // TrueAim check
                        float shottype;
-                       float bullets, ring_scale;
+                       float weapon_clipload, weapon_clipsize, ring_scale;
                        // wcross_origin = '0.5 0 0' * vid_conwidth + '0 0.5 0' * vid_conheight;
                        wcross_origin = project_3d_to_2d(view_origin + MAX_SHOT_DISTANCE * view_forward);
                        wcross_origin_z = 0;
@@ -1076,16 +1076,17 @@ void CSQC_UpdateView(float w, float h)
                        if(nex_charge_movingavg == 0) // this should only happen if we have just loaded up the game
                                nex_charge_movingavg = nex_charge;
 
-                       // ring around crosshair representing bullets left in camping rifle clip
-                       if (activeweapon == WEP_SNIPERRIFLE && cr_maxbullets)
+                       // ring around crosshair representing bullets left in weapon clip
+                       weapon_clipload = getstati(STAT_WEAPON_CLIPLOAD);
+                       if (weapon_clipload)
                        {
-                               bullets = getstati(STAT_BULLETS_LOADED);
-                               f = bound(0, bullets / cr_maxbullets, 1);
+                               weapon_clipsize = getstati(STAT_WEAPON_CLIPSIZE);
+                               f = bound(0, weapon_clipload / weapon_clipsize, 1);
 
                                a = autocvar_crosshair_ring_sniperrifle_alpha;
                                DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring.tga", f, wcross_color, wcross_alpha * a, DRAWFLAG_ADDITIVE);
                        }
-                       else if (activeweapon == WEP_NEX && nex_charge) // ring around crosshair representing velocity-dependent damage for the nex
+                       if (activeweapon == WEP_NEX && nex_charge) // ring around crosshair representing velocity-dependent damage for the nex
                        {
                                if(nex_chargepool || use_nex_chargepool)
                                {