]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Stop button2 from beeing zoom if you help a nex or rifle when entering a vehicle
authorJakob MG <jakob_mg@hotmail.com>
Tue, 21 Jun 2011 13:01:32 +0000 (15:01 +0200)
committerJakob MG <jakob_mg@hotmail.com>
Tue, 21 Jun 2011 13:01:32 +0000 (15:01 +0200)
qcsrc/client/View.qc

index 89fcbe1f4ee73261a005e080f90881876af5c835..870da0d7b04824cfb8dafa007dcc4a62f65d1f62 100644 (file)
@@ -128,6 +128,7 @@ vector GetCurrentFov(float fov)
                        zoomspeed = 3.5;
 
        zoomdir = button_zoom;
+       if(hud == HUD_NORMAL)
        if((getstati(STAT_ACTIVEWEAPON) == WEP_NEX && nex_scope) || (getstati(STAT_ACTIVEWEAPON) == WEP_RIFLE && rifle_scope)) // do NOT use switchweapon here
                zoomdir += button_attack2;
        if(spectatee_status > 0 || isdemo())
@@ -664,12 +665,12 @@ void CSQC_UpdateView(float w, float h)
                R_PolygonVertex(autocvar_vid_conheight * '0 1 0', tc_01, rgb, a);
                R_EndPolygon();
        }
-
+        
        // 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
        // It must be a persisted float for fading out to work properly (you let go of the zoom button for
        // the view to go back to normal, so reticle_type would become 0 as we fade out)
-       if(spectatee_status || getstati(STAT_HEALTH) <= 0)
+       if(spectatee_status || getstati(STAT_HEALTH) <= 0 || hud != HUD_NORMAL)
                reticle_type = 0; // prevent reticle from showing during the respawn zoom effect or for spectators
        else if(activeweapon == WEP_NEX && (button_zoom || zoomscript_caught) || activeweapon == WEP_RIFLE && (button_zoom || zoomscript_caught) || activeweapon == WEP_MINSTANEX && (button_zoom || zoomscript_caught))
                reticle_type = 2; // nex zoom
@@ -677,7 +678,7 @@ void CSQC_UpdateView(float w, float h)
                reticle_type = 1; // normal zoom
        else if(activeweapon == WEP_NEX && button_attack2 || activeweapon == WEP_RIFLE && button_attack2)
                reticle_type = 2; // nex zoom
-
+    
        if (reticle_type)
        {
                if(autocvar_cl_reticle_stretch)