From 2016bef5c40acec4f26a7d48149a99f386ea6085 Mon Sep 17 00:00:00 2001 From: Leonmmcoset Date: Mon, 1 Sep 2025 17:52:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=94=B9=E8=BF=9B=E9=87=8D=E5=90=AF?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BB=A5=E6=94=AF=E6=8C=81os.reboot=E5=9B=9E?= =?UTF-8?q?=E9=80=80=E6=96=B9=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 当os.reboot可用时优先使用,否则回退到shutdown函数,确保重启功能更可靠 --- data/computercraft/lua/bios.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/data/computercraft/lua/bios.lua b/data/computercraft/lua/bios.lua index a7fc819..1797d15 100644 --- a/data/computercraft/lua/bios.lua +++ b/data/computercraft/lua/bios.lua @@ -56,7 +56,13 @@ function rc.shutdown() end function rc.reboot() - reboot() + -- Try to use os.reboot if available + if os.reboot then + os.reboot() + else + -- Fallback to shutdown if reboot isn't available + shutdown() + end while true do coroutine.yield() end end local timer_filter = {}