From: Mario Date: Fri, 10 Feb 2017 12:57:55 +0000 (+1000) Subject: Make sure a bad string can't be drawn in reticle code X-Git-Tag: xonotic-v0.8.2~233 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=04f3c72e87f63adf935d05039f0e3f752b4dd99a;p=xonotic%2Fxonotic-data.pk3dir.git Make sure a bad string can't be drawn in reticle code --- diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index ae6b0ee76..8b96e6a26 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -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; } } } diff --git a/qcsrc/common/weapons/weapon.qh b/qcsrc/common/weapons/weapon.qh index 0d0f67bef..69fcc1d07 100644 --- a/qcsrc/common/weapons/weapon.qh +++ b/qcsrc/common/weapons/weapon.qh @@ -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 */