From: terencehill Date: Sun, 11 Jul 2021 19:00:48 +0000 (+0200) Subject: Fix #2611 "Continuous div by 0 error spam while scoreboard is displayed" X-Git-Tag: xonotic-v0.8.5~377 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1ed40dcd011e38d29b3d773d8d9205c559cd4af6;p=xonotic%2Fxonotic-data.pk3dir.git Fix #2611 "Continuous div by 0 error spam while scoreboard is displayed" --- diff --git a/qcsrc/client/hud/panel/scoreboard.qc b/qcsrc/client/hud/panel/scoreboard.qc index 4a815424d..3ab5b6c03 100644 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@ -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; }