From 61e38d89e8ebdf940e7d757344e2e9601825c448 Mon Sep 17 00:00:00 2001 From: Robert Jelic <36573031+NoryiE@users.noreply.github.com> Date: Fri, 30 Dec 2022 02:30:48 +0100 Subject: [PATCH] Update images.lua --- Basalt/libraries/images.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Basalt/libraries/images.lua b/Basalt/libraries/images.lua index e60edf5..acfefef 100644 --- a/Basalt/libraries/images.lua +++ b/Basalt/libraries/images.lua @@ -2,12 +2,14 @@ local sub,floor,rep = string.sub,math.floor,string.rep local function loadNFPAsBimg(path) local bimg = {{}} - local nfp = fs.open("test.nfp", "r") - for line in nfp.readLine do - table.insert(bimg[1], {rep(" ",#line), rep(" ",#line), line}) + local nfp = fs.open(path, "r") + if(nfp~=nil)then + for line in nfp.readLine do + table.insert(bimg[1], {rep(" ",#line), rep(" ",#line), line}) + end + nfp.close() + return bimg end - nfp.close() - return bimg end local function loadNFP(path)