From 941a32d99caf4406d86b9fc85440c875d4ca5207 Mon Sep 17 00:00:00 2001 From: Cerapter Date: Wed, 12 Dec 2018 18:55:16 +0100 Subject: [PATCH] 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. --- courtroom.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/courtroom.cpp b/courtroom.cpp index 66e29ca..3da69ad 100644 --- a/courtroom.cpp +++ b/courtroom.cpp @@ -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); 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(); } @@ -2611,7 +2611,7 @@ void Courtroom::handle_song(QStringList *p_contents) chatlogpiece* temp = new chatlogpiece(str_char, str_show, f_song, true); 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(); }