From 1030330addd214fa54447c8908583c592dea21fb Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Tue, 15 Dec 2020 15:22:18 +0800 Subject: [PATCH] =?UTF-8?q?win=E5=92=8Clinux=E7=BC=BA=E5=BA=93=E4=B9=9F?= =?UTF-8?q?=E8=AE=B8=E4=B8=8D=E4=BC=9A=E5=86=8D=E9=97=AA=E9=80=80=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/toolfunc.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Zframework/toolfunc.lua b/Zframework/toolfunc.lua index 67648d47..a5b0735c 100644 --- a/Zframework/toolfunc.lua +++ b/Zframework/toolfunc.lua @@ -21,11 +21,11 @@ do--LOADLIB function LOADLIB(name) local libName=libs[name] if SYSTEM=="Windows"or SYSTEM=="Linux"then - local success,message=require(libName[SYSTEM]) - if success then - return success + local r1,r2,r3=pcall(require,libName[SYSTEM]) + if r1 and r2 then + return r2 else - LOG.print("Cannot load "..name..": "..message,"warn",COLOR.red) + LOG.print("Cannot load "..name..": "..(r2 or r3),"warn",COLOR.red) end elseif SYSTEM=="Android"then local fs=love.filesystem @@ -51,7 +51,7 @@ do--LOADLIB end end if not libFunc then - LOG.print("failed to load "..name,"warn",COLOR.red) + LOG.print("Cannot load "..name,"warn",COLOR.red) return end return libFunc()