bugfix: deleting definitions

scenario: delete a definition, restart
Before this commit, the deleted definition would return.
This commit is contained in:
Kartik K. Agaram 2023-04-30 22:02:29 -07:00
parent ed2eddac57
commit acc2fea361
1 changed files with 8 additions and 6 deletions

View File

@ -59,12 +59,14 @@ function live.load_files_so_far()
end
-- load files from save dir
for _,filename in ipairs(love.filesystem.getDirectoryItems('')) do
local numeric_prefix, root = filename:match('^(%d+)-(.+)')
if numeric_prefix then
if tonumber(numeric_prefix) > 0 then -- skip 0000
Live.filename[root] = filename
table.insert(Live.filenames_to_load, filename)
Live.final_prefix = math.max(Live.final_prefix, tonumber(numeric_prefix))
if io.open(love.filesystem.getSaveDirectory()..'/'..filename) then
local numeric_prefix, root = filename:match('^(%d+)-(.+)')
if numeric_prefix then
if tonumber(numeric_prefix) > 0 then -- skip 0000
Live.filename[root] = filename
table.insert(Live.filenames_to_load, filename)
Live.final_prefix = math.max(Live.final_prefix, tonumber(numeric_prefix))
end
end
end
end