From 10d3beb600e216e96647f1847132fcd3fd988580 Mon Sep 17 00:00:00 2001 From: Leonmmcoset Date: Mon, 1 Sep 2025 17:37:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E7=89=88=E6=9C=AC=E5=8F=B7=E5=B9=B6=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E7=BA=BF=E7=A8=8BID=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除线程模块中不必要的错误检查,避免在非线程环境中调用api.id()时抛出错误 --- data/computercraft/lua/bios.lua | 4 ++-- data/computercraft/lua/rom/modules/main/rc/thread.lua | 6 +++--- installer.lua | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/data/computercraft/lua/bios.lua b/data/computercraft/lua/bios.lua index ad9e712..a7fc819 100644 --- a/data/computercraft/lua/bios.lua +++ b/data/computercraft/lua/bios.lua @@ -1,4 +1,4 @@ -_G._HOST = _G._HOST .. " (LeonOS 0.2.4)" +_G._HOST = _G._HOST .. " (LeonOS 0.2.5)" local fs = rawget(_G, "fs") _G._RC_ROM_DIR = _RC_ROM_DIR or (...) and fs.exists("/leonos") and "/leonos" or "/rom" @@ -32,7 +32,7 @@ local rc = { _VERSION = { major = 0, minor = 2, - patch = 4 + patch = 5 }, queueEvent = pull(os, "queueEvent"), startTimer = pull(os, "startTimer"), diff --git a/data/computercraft/lua/rom/modules/main/rc/thread.lua b/data/computercraft/lua/rom/modules/main/rc/thread.lua index d375f37..8315424 100644 --- a/data/computercraft/lua/rom/modules/main/rc/thread.lua +++ b/data/computercraft/lua/rom/modules/main/rc/thread.lua @@ -103,9 +103,9 @@ function api.exists(id) end function api.id() - if not current then - error("No current thread - are you calling this outside a thread?") - end + -- if not current then + -- error("No current thread - are you calling this outside a thread?") + -- end return current.id end diff --git a/installer.lua b/installer.lua index 8916480..7deabb4 100644 --- a/installer.lua +++ b/installer.lua @@ -1,5 +1,5 @@ -- LeonOS installer -local INSTALLER_VERSION = "0.2.4" +local INSTALLER_VERSION = "0.2.5" local DEFAULT_ROM_DIR = "/leonos" print("Start loading LeonOS installer ("..INSTALLER_VERSION..")...")