]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Make sure a bad string can't be drawn in reticle code
authorMario <mario@smbclan.net>
Fri, 10 Feb 2017 12:57:55 +0000 (22:57 +1000)
committerMario <mario@smbclan.net>
Fri, 10 Feb 2017 12:57:55 +0000 (22:57 +1000)
qcsrc/client/view.qc
qcsrc/common/weapons/weapon.qh

index ae6b0ee7638ae0a3b36fc0b1e0e9a3b181ad4197..8b96e6a269755e07f5d4175613ea5c5bc3b542f7 100644 (file)
@@ -2014,7 +2014,7 @@ void CSQC_UpdateView(entity this, float w, float h)
                                switch(reticle_type)
                                {
                                        case 1: drawpic(reticle_pos, "gfx/reticle_normal", reticle_size, '1 1 1', f * autocvar_cl_reticle_normal_alpha, DRAWFLAG_NORMAL); break;
-                                       case 2: drawpic(reticle_pos, reticle_image, reticle_size, '1 1 1', f * autocvar_cl_reticle_weapon_alpha, DRAWFLAG_NORMAL); break;
+                                       case 2: if(reticle_image) drawpic(reticle_pos, reticle_image, reticle_size, '1 1 1', f * autocvar_cl_reticle_weapon_alpha, DRAWFLAG_NORMAL); break;
                                }
                        }
                }
index 0d0f67bef30c7011200ec45eedf5f63f1f19202d..69fcc1d07e508931746209e70f2f6a7815cef8d5 100644 (file)
@@ -76,7 +76,7 @@ CLASS(Weapon, Object)
     /** A: crosshair : per-weapon crosshair size (argument two of "crosshair" field) */
     ATTRIB(Weapon, w_crosshair_size, float, 1);
     /** A: reticle   : per-weapon zoom reticle */
-    ATTRIB(Weapon, w_reticle, string, "");
+    ATTRIB(Weapon, w_reticle, string, string_null);
     /** M: wepimg    : "weaponfoobar" side view image file of weapon. WEAPONTODO: Move out of skin files, move to common files */
     ATTRIB(Weapon, model2, string, "");
     /** M: refname   : reference name name */