Check whether sprees file exist (fixes #89)

This commit is contained in:
Timo Smit 2019-01-17 11:12:48 +01:00
parent 2762ff7507
commit 415835c723

View file

@ -116,6 +116,11 @@ function sprees.load()
if string.find(fileName, ".toml") == string.len(fileName) - 4 then
local fileDescriptor, fileLength = et.trap_FS_FOpenFile(fileName, et.FS_READ)
if fileLength == -1 then
return 0
end
local fileString = et.trap_FS_Read(fileDescriptor, fileLength)
et.trap_FS_FCloseFile(fileDescriptor)