aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCerapter <cerap@protonmail.com>2018-08-13 22:35:31 +0200
committerCerapter <cerap@protonmail.com>2018-08-13 22:35:31 +0200
commitd36fdace38833ee468afff785e68e90b86b81a10 (patch)
tree25bc454b23c21ea2b4b076bc76b2beb4dbf810ba
parent2aec9710e5c83fe45d643307bad0f6dcbdf2f831 (diff)
Fixed a bug where a server having less characters than you could fit on your screen would crash the game.
-rw-r--r--charselect.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/charselect.cpp b/charselect.cpp
index bfa59608..abc481d4 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()