]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
If the size in input to drawpic_aspect is 0 do not draw the image
authorterencehill <piuntn@gmail.com>
Sun, 15 Jan 2012 14:48:45 +0000 (15:48 +0100)
committerterencehill <piuntn@gmail.com>
Sun, 15 Jan 2012 14:48:45 +0000 (15:48 +0100)
qcsrc/client/miscfunctions.qc

index f4eaf927fe2b56943cc8e0ec2c287080a8325d43..ff5dd07ff3386013b89b8a5c1684922d0dafe382 100644 (file)
@@ -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)