From 2fbc301ec9b27476f8c164e2155123c1f96848ce Mon Sep 17 00:00:00 2001 From: Verkister Date: Tue, 30 Nov 2021 17:33:14 +0200 Subject: [PATCH] Fixes a vchat runtime Sometimes the proc above returns something that is not a list. --- code/modules/vchat/vchat_client.dm | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/code/modules/vchat/vchat_client.dm b/code/modules/vchat/vchat_client.dm index b2cd9df7589..a918c94cde5 100644 --- a/code/modules/vchat/vchat_client.dm +++ b/code/modules/vchat/vchat_client.dm @@ -139,14 +139,15 @@ GLOBAL_DATUM_INIT(iconCache, /savefile, new("data/iconCache.sav")) //Cache of ic set waitfor = FALSE // Only send them the number of buffered messages, instead of the ENTIRE log var/list/results = vchat_get_messages(owner.ckey, message_buffer) //If there's bad performance on reconnects, look no further - for(var/i in results.len to 1 step -1) - var/list/message = results[i] - var/count = 10 - to_chat_immediate(owner, message["time"], message["message"]) - count++ - if(count >= 10) - count = 0 - CHECK_TICK + if(islist(results)) + for(var/i in results.len to 1 step -1) + var/list/message = results[i] + var/count = 10 + to_chat_immediate(owner, message["time"], message["message"]) + count++ + if(count >= 10) + count = 0 + CHECK_TICK //It din work /datum/chatOutput/proc/become_broken() @@ -417,4 +418,4 @@ var/to_chat_src if(!fdel(o_file)) spawn(1 MINUTE) if(!fdel(o_file)) - log_debug("Warning: [ckey]'s chatlog could not be deleted one minute after file transfer was initiated. It is located at 'data/chatlog_tmp/[ckey]_chat_log' and will need to be manually removed.") \ No newline at end of file + log_debug("Warning: [ckey]'s chatlog could not be deleted one minute after file transfer was initiated. It is located at 'data/chatlog_tmp/[ckey]_chat_log' and will need to be manually removed.")