From: terencehill Date: Fri, 9 Sep 2016 19:10:01 +0000 (+0200) Subject: Avoid a division by 0 (it happened playing DOM on a map that doesn't support DOM) X-Git-Tag: xonotic-v0.8.2~610 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=058ef479b88179ef85a318e27e1c2030326ac4ce;p=xonotic%2Fxonotic-data.pk3dir.git Avoid a division by 0 (it happened playing DOM on a map that doesn't support DOM) --- diff --git a/qcsrc/client/hud/panel/modicons.qc b/qcsrc/client/hud/panel/modicons.qc index 2a12e81c2..a4d84cf9e 100644 --- a/qcsrc/client/hud/panel/modicons.qc +++ b/qcsrc/client/hud/panel/modicons.qc @@ -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) {