Add a hook to allow mutators to disable the zoom reticle
authorMario <mario@smbclan.net>
Mon, 20 May 2019 08:25:07 +0000 (18:25 +1000)
committerMario <mario@smbclan.net>
Mon, 20 May 2019 08:25:07 +0000 (18:25 +1000)
qcsrc/client/mutators/events.qh
qcsrc/client/view.qc

index cc6fced..e9778b7 100644 (file)
@@ -199,3 +199,6 @@ MUTATOR_HOOKABLE(ForcePlayermodels_Skip, EV_ForcePlayermodels_Skip);
        /** hit origin */               i(vector, MUTATOR_ARGV_2_vector) \
        /**/
 MUTATOR_HOOKABLE(DamageInfo, EV_DamageInfo);
+
+/** Return true to not draw zoom reticle */
+MUTATOR_HOOKABLE(DrawReticle, EV_NO_ARGS);
index be4b8f4..322abb8 100644 (file)
@@ -2188,7 +2188,7 @@ void CSQC_UpdateView(entity this, float w, float h)
                R_EndPolygon();
        }
 
-       if(autocvar_cl_reticle)
+       if(autocvar_cl_reticle && !MUTATOR_CALLHOOK(DrawReticle))
        {
                string reticle_image = string_null;
                bool wep_zoomed = false;