]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix #2611 "Continuous div by 0 error spam while scoreboard is displayed"
authorterencehill <piuntn@gmail.com>
Sun, 11 Jul 2021 19:00:48 +0000 (21:00 +0200)
committerterencehill <piuntn@gmail.com>
Sun, 11 Jul 2021 19:00:48 +0000 (21:00 +0200)
qcsrc/client/hud/panel/scoreboard.qc

index 4a815424de7ab3948cb9f46913d32b91e90aacab..3ab5b6c0370d3bd232d99e1c822315e519ff1877 100644 (file)
@@ -2154,12 +2154,15 @@ void Scoreboard_Draw()
                        scoreboard_bottom = max(pos.y, scoreboard_bottom - frametime * 10 * (pos.y - scoreboard_top));
        }
 
-       if (scoreboard_fade_alpha == 1)
+       if (rankings_cnt)
        {
-               if (scoreboard_bottom > 0.95 * vid_conheight)
-                       rankings_rows = max(1, rankings_rows - 1);
-               else if (scoreboard_bottom + 1.25 * hud_fontsize.y < 0.95 * vid_conheight)
-                       rankings_rows = min(ceil(RANKINGS_RECEIVED_CNT / rankings_columns), rankings_rows + 1);
+               if (scoreboard_fade_alpha == 1)
+               {
+                       if (scoreboard_bottom > 0.95 * vid_conheight)
+                               rankings_rows = max(1, rankings_rows - 1);
+                       else if (scoreboard_bottom + 1.25 * hud_fontsize.y < 0.95 * vid_conheight)
+                               rankings_rows = min(ceil(RANKINGS_RECEIVED_CNT / rankings_columns), rankings_rows + 1);
+               }
+               rankings_cnt = rankings_rows * rankings_columns;
        }
-       rankings_cnt = rankings_rows * rankings_columns;
 }