小修格式

This commit is contained in:
MrZ_26
2023-06-12 12:16:06 +08:00
parent 4ec1f7c5c8
commit aff7ffb2c4
2 changed files with 7 additions and 13 deletions

View File

@@ -559,14 +559,13 @@ applySettings()
-- Load replays
for _,fileName in next,fs.getDirectoryItems('replay') do
while fileName:sub(12,12):match("[a-zA-Z]") do
if fileName:sub(12,12):match("[a-zA-Z]") then repeat
local date,mode,version,player,seed,setting,mod
local fileData=fs.read('replay/'..fileName)
local success,fileData=true,fs.read('replay/'..fileName)
date, fileData=STRING.readLine(fileData)date=date:gsub("[a-zA-Z]","")
mode, fileData=STRING.readLine(fileData)mode=MODE_UPDATE_MAP[mode] or mode
version,fileData=STRING.readLine(fileData)
player, fileData=STRING.readLine(fileData) if player=="Local Player" then player="Stacker" end
local success
success,fileData=pcall(love.data.decompress,'string','zlib',fileData)
if not success then break end
seed, fileData=STRING.readLine(fileData)
@@ -596,8 +595,7 @@ for _,fileName in next,fs.getDirectoryItems('replay') do
)
)
fileName=newName
break
end
until true end
local rep=DATA.parseReplay('replay/'..fileName)
table.insert(REPLAY,rep)
end