From: terencehill Date: Sun, 15 Jan 2012 14:48:45 +0000 (+0100) Subject: If the size in input to drawpic_aspect is 0 do not draw the image X-Git-Tag: xonotic-v0.6.0~78^2^2~2^2~9 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=23d3efcee11b2a9949c33a512c7843cbc924234e;p=xonotic%2Fxonotic-data.pk3dir.git If the size in input to drawpic_aspect is 0 do not draw the image --- diff --git a/qcsrc/client/miscfunctions.qc b/qcsrc/client/miscfunctions.qc index f4eaf927f..ff5dd07ff 100644 --- a/qcsrc/client/miscfunctions.qc +++ b/qcsrc/client/miscfunctions.qc @@ -284,11 +284,13 @@ var string _drawpic_picpath; if(_drawpic_sz_x/_drawpic_sz_y > _drawpic_imgaspect) {\ _drawpic_oldsz = _drawpic_sz_x;\ _drawpic_sz_x = _drawpic_sz_y * _drawpic_imgaspect;\ - drawpic(pos + eX * (_drawpic_oldsz - _drawpic_sz_x) * 0.5, pic, _drawpic_sz, color, theAlpha, drawflag);\ + if(_drawpic_sz_x)\ + drawpic(pos + eX * (_drawpic_oldsz - _drawpic_sz_x) * 0.5, pic, _drawpic_sz, color, theAlpha, drawflag);\ } else {\ _drawpic_oldsz = _drawpic_sz_y;\ _drawpic_sz_y = _drawpic_sz_x / _drawpic_imgaspect;\ - drawpic(pos + eY * (_drawpic_oldsz - _drawpic_sz_y) * 0.5, pic, _drawpic_sz, color, theAlpha, drawflag);\ + if(_drawpic_sz_y)\ + drawpic(pos + eY * (_drawpic_oldsz - _drawpic_sz_y) * 0.5, pic, _drawpic_sz, color, theAlpha, drawflag);\ }\ } while(0)