Fixed a bug where your chatlog would completely erase if you had a limit of 0.

A limit of zero otherwise means infinite, so no log limit.
This commit is contained in:
Cerapter 2018-12-12 18:55:16 +01:00
parent 1dcdb0f5d8
commit 941a32d99c

View File

@ -1309,7 +1309,7 @@ void Courtroom::handle_chatmessage(QStringList *p_contents)
chatlogpiece* temp = new chatlogpiece(ao_app->get_showname(char_list.at(f_char_id).name), f_showname, ": " + m_chatmessage[MESSAGE], false); chatlogpiece* temp = new chatlogpiece(ao_app->get_showname(char_list.at(f_char_id).name), f_showname, ": " + m_chatmessage[MESSAGE], false);
ic_chatlog_history.append(*temp); ic_chatlog_history.append(*temp);
while(ic_chatlog_history.size() > log_maximum_blocks) while(ic_chatlog_history.size() > log_maximum_blocks && log_maximum_blocks > 0)
{ {
ic_chatlog_history.removeFirst(); ic_chatlog_history.removeFirst();
} }
@ -2611,7 +2611,7 @@ void Courtroom::handle_song(QStringList *p_contents)
chatlogpiece* temp = new chatlogpiece(str_char, str_show, f_song, true); chatlogpiece* temp = new chatlogpiece(str_char, str_show, f_song, true);
ic_chatlog_history.append(*temp); ic_chatlog_history.append(*temp);
while(ic_chatlog_history.size() > log_maximum_blocks) while(ic_chatlog_history.size() > log_maximum_blocks && log_maximum_blocks > 0)
{ {
ic_chatlog_history.removeFirst(); ic_chatlog_history.removeFirst();
} }