]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/w_vortex.qc
Make it so that weapon zoom reticles are in weapon code, not view code
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / w_vortex.qc
index a8d0ea1317315756a82d633dad6b59ffda10847b..6a43b1e465d0885badbb5481d4e93ce16a51b646 100644 (file)
@@ -293,6 +293,7 @@ float W_Vortex(float req)
 }
 #endif
 #ifdef CSQC
+var float autocvar_g_balance_vortex_secondary = 0; // WEAPONTODO
 float W_Vortex(float req)
 {
        switch(req)
@@ -310,8 +311,25 @@ float W_Vortex(float req)
                case WR_INIT:
                {
                        precache_sound("weapons/neximpact.wav");
+                       if(autocvar_cl_reticle && autocvar_cl_reticle_weapon)
+                       {
+                               precache_pic("gfx/reticle_nex");
+                       }
                        return TRUE;
                }
+               case WR_ZOOMRETICLE:
+               {
+                       if(button_zoom || zoomscript_caught || (!WEP_CVAR(vortex, secondary) && button_attack2))
+                       {
+                               reticle_image = "gfx/reticle_nex";
+                               return TRUE;
+                       }
+                       else
+                       {
+                               // no weapon specific image for this weapon
+                               return FALSE;
+                       }
+               }
        }
        return TRUE;
 }