]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Avoid a division by 0 (it happened playing DOM on a map that doesn't support DOM)
authorterencehill <piuntn@gmail.com>
Fri, 9 Sep 2016 19:10:01 +0000 (21:10 +0200)
committerterencehill <piuntn@gmail.com>
Fri, 9 Sep 2016 19:10:01 +0000 (21:10 +0200)
qcsrc/client/hud/panel/modicons.qc

index 2a12e81c25e140db54908ee2bc4710aabe7d2f5b..a4d84cf9e8694eea15eb467b8b7c1a6e5b71ec4c 100644 (file)
@@ -676,7 +676,9 @@ void DrawDomItem(vector myPos, vector mySize, float aspect_ratio, int layout, in
                        color = '1 0 1';
                        break;
        }
-       float pps_ratio = stat / STAT(DOM_TOTAL_PPS);
+       float pps_ratio = 0;
+       if(STAT(DOM_TOTAL_PPS))
+               pps_ratio = stat / STAT(DOM_TOTAL_PPS);
 
        if(mySize.x/mySize.y > aspect_ratio)
        {