From 3ffe835b38884e27ab823ce91af6e298e4adb7ae Mon Sep 17 00:00:00 2001
From: Nigel Reed <nigel@nigelreed.net>
Date: Fri, 1 Sep 2023 12:23:12 -0500
Subject: [PATCH] Fix for js.time_limit stuck at 0 When setting js.time_limit
 in mirc-client.js the value sticks throughout the session, which means any
 other scripts run will also have js.time_limit = 0. This modification stores
 the value of js.time_limit upon invocation and then resets it when the main
 loop terminates. While this should be sufficient in most cases, it obviously
 won't catch something due to an error. These should be rare if not
 non-existent now.

---
 xtrn/mrc/mrc-client.js | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xtrn/mrc/mrc-client.js b/xtrn/mrc/mrc-client.js
index 9a074bb43b..571a481b28 100644
--- a/xtrn/mrc/mrc-client.js
+++ b/xtrn/mrc/mrc-client.js
@@ -13,6 +13,7 @@ load('scrollbar.js');
 load('inputline.js');
 load(js.startup_dir + 'mrc-session.js');
 
+var orig_timelimit = js.time_limit;
 js.time_limit=0;
 
 var input_state = 'chat';
@@ -377,6 +378,7 @@ function main() {
         }
         yield();
     }
+    js.time_limit = orig_timelimit;
 
 }
 
-- 
GitLab