From d36fdace38833ee468afff785e68e90b86b81a10 Mon Sep 17 00:00:00 2001 From: Cerapter Date: Mon, 13 Aug 2018 22:35:31 +0200 Subject: [PATCH] Fixed a bug where a server having less characters than you could fit on your screen would crash the game. --- charselect.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/charselect.cpp b/charselect.cpp index bfa5960..abc481d 100644 --- a/charselect.cpp +++ b/charselect.cpp @@ -186,7 +186,12 @@ void Courtroom::character_loading_finished() } filter_character_list(); - put_button_in_place(0, max_chars_on_page); + + int chars_on_page = max_chars_on_page; + if (ui_char_button_list_filtered.size() < max_chars_on_page) + chars_on_page = ui_char_button_list_filtered.size(); + put_button_in_place(0, chars_on_page); + } void Courtroom::filter_character_list()