]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/view.qc
Merge branch 'master' into Mario/wepent_experimental
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / view.qc
index ac58fd7927f82668c585e1cd747ca2e7ebc5fb42..def064d499e6fca7979c2e150e674e4c49a590c4 100644 (file)
@@ -726,7 +726,6 @@ float camera_mode;
 const float CAMERA_FREE = 1;
 const float CAMERA_CHASE = 2;
 float reticle_type;
-string reticle_image;
 string NextFrameCommand;
 
 vector freeze_org, freeze_ang;
@@ -1155,10 +1154,6 @@ void HUD_Crosshair(entity this)
                                weapon_clipload = STAT(WEAPON_CLIPLOAD);
                                weapon_clipsize = STAT(WEAPON_CLIPSIZE);
 
-                               float ok_ammo_charge, ok_ammo_chargepool;
-                               ok_ammo_charge = STAT(OK_AMMO_CHARGE);
-                               ok_ammo_chargepool = STAT(OK_AMMO_CHARGEPOOL);
-
                                float vortex_charge, vortex_chargepool;
                                vortex_charge = STAT(VORTEX_CHARGE);
                                vortex_chargepool = STAT(VORTEX_CHARGEPOOL);
@@ -1205,13 +1200,6 @@ void HUD_Crosshair(entity this)
                                        ring_rgb = wcross_color;
                                        ring_image = "gfx/crosshair_ring.tga";
                                }
-                               else if (ok_ammo_charge)
-                               {
-                                       ring_value = ok_ammo_chargepool;
-                                       ring_alpha = autocvar_crosshair_ring_reload_alpha;
-                                       ring_rgb = wcross_color;
-                                       ring_image = "gfx/crosshair_ring.tga";
-                               }
                                else if(autocvar_crosshair_ring_reload && weapon_clipsize) // forces there to be only an ammo ring
                                {
                                        ring_value = bound(0, weapon_clipload / weapon_clipsize, 1);
@@ -1948,13 +1936,18 @@ void CSQC_UpdateView(entity this, float w, float h)
 
        if(autocvar_cl_reticle)
        {
+               string reticle_image = wepent.activeweapon.w_reticle;
                bool wep_zoomed = false;
                for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
                {
                        entity wepe = viewmodels[slot];
                        Weapon wep = wepe.activeweapon;
                        if(wep != WEP_Null && wep.wr_zoom)
-                               wep_zoomed += wep.wr_zoom(wep, NULL);
+                       {
+                               bool do_zoom = wep.wr_zoom(wep, NULL);
+                               reticle_image = wep.w_reticle;
+                               wep_zoomed += do_zoom;
+                       }
                }
                // Draw the aiming reticle for weapons that use it
                // reticle_type is changed to the item we are zooming / aiming with, to decide which reticle to use
@@ -1967,7 +1960,7 @@ void CSQC_UpdateView(entity this, float w, float h)
                }
                else if(wep_zoomed && autocvar_cl_reticle_weapon)
                {
-                       if(reticle_image != "") { reticle_type = 2; }
+                       if(reticle_image && reticle_image != "") { reticle_type = 2; }
                        else { reticle_type = 0; }
                }
                else if(button_zoom || zoomscript_caught)