Fixed a bug where the character selection screen would pile up charicons.

- Also fixed the loading bar showing wrong values.
This commit is contained in:
Cerapter 2018-08-14 16:33:35 +02:00
parent b99e9c18b2
commit f81a9adc99
2 changed files with 10 additions and 1 deletions

View File

@ -175,6 +175,15 @@ void Courtroom::put_button_in_place(int starting, int chars_on_this_page)
void Courtroom::character_loading_finished()
{
// Zeroeth, we'll clear any leftover characters from previous server visits.
if (ui_char_button_list.size() > 0)
{
foreach (AOCharButton* item, ui_char_button_list) {
delete item;
}
ui_char_button_list.clear();
}
// First, we'll make all the character buttons in the very beginning.
// We also hide them all, so they can't be accidentally clicked.
// Later on, we'll be revealing buttons as we need them.

View File

@ -218,6 +218,7 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
loaded_chars = 0;
loaded_evidence = 0;
loaded_music = 0;
generated_chars = 0;
destruct_courtroom();
construct_courtroom();
@ -419,7 +420,6 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
int loading_value = int(((loaded_chars + generated_chars + loaded_music + loaded_evidence) / static_cast<double>(total_loading_size)) * 100);
w_lobby->set_loading_value(loading_value);
}
w_courtroom->character_loading_finished();
send_server_packet(new AOPacket("RM#%"));
}