From cb9563ab094f3a5f22f37afb462644dfb8068c68 Mon Sep 17 00:00:00 2001 From: Fluffy Jenkins Date: Wed, 8 Jan 2020 04:42:00 +0000 Subject: [PATCH] Fixed chat history bug --- scripts/communityModules/chat/FloofChat.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/communityModules/chat/FloofChat.js b/scripts/communityModules/chat/FloofChat.js index 0dc4e6e29d..1bff83bd0d 100644 --- a/scripts/communityModules/chat/FloofChat.js +++ b/scripts/communityModules/chat/FloofChat.js @@ -361,8 +361,8 @@ function time() { function addToLog(msg, dp, colour, tab) { historyLog.push([time(), msg, dp, colour, tab]); chatHistory.emitScriptEvent(JSON.stringify({type: "MSG", data: [[time(), msg, dp, colour, tab]]})); - if (historyLog.length > 500) { - historyLog.pop(); + while(historyLog.length > 500) { + historyLog.shift(); } Settings.setValue(settingsRoot + "/HistoryLog", JSON.stringify(historyLog)) }