Skip to content

Commit 61e38d8

Browse files
authored
Update images.lua
1 parent a0db5ec commit 61e38d8

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Basalt/libraries/images.lua

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ local sub,floor,rep = string.sub,math.floor,string.rep
22

33
local function loadNFPAsBimg(path)
44
local bimg = {{}}
5-
local nfp = fs.open("test.nfp", "r")
6-
for line in nfp.readLine do
7-
table.insert(bimg[1], {rep(" ",#line), rep(" ",#line), line})
5+
local nfp = fs.open(path, "r")
6+
if(nfp~=nil)then
7+
for line in nfp.readLine do
8+
table.insert(bimg[1], {rep(" ",#line), rep(" ",#line), line})
9+
end
10+
nfp.close()
11+
return bimg
812
end
9-
nfp.close()
10-
return bimg
1113
end
1214

1315
local function loadNFP(path)

0 commit comments

Comments
 (0)