From ccc40411ea7e54db889240b28444e8b6d77e9f30 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Mon, 4 Jan 2021 21:54:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E4=B8=A5=E8=B0=A8=E7=9A=84=E8=83=8C?= =?UTF-8?q?=E6=99=AF=E6=96=87=E4=BB=B6=E8=AF=BB=E5=8F=96=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E4=BC=9A=E8=AF=BB=E5=88=B0=E9=9D=9Elua=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.lua b/main.lua index 28d25b9d..c4e29078 100644 --- a/main.lua +++ b/main.lua @@ -285,8 +285,10 @@ end --Load background files from SOURCE ONLY for _,v in next,love.filesystem.getDirectoryItems("parts/backgrounds")do if love.filesystem.getRealDirectory("parts/backgrounds/"..v)~=SAVEDIR then - local name=v:sub(1,-5) - BG.add(name,require("parts/backgrounds/"..name)) + if v:sub(-3)=="lua"then + local name=v:sub(1,-5) + BG.add(name,require("parts/backgrounds/"..name)) + end else LOG.print("Dangerous file : %SAVE%/parts/backgrounds/"..v) end