小修格式

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 -- Load replays
for _,fileName in next,fs.getDirectoryItems('replay') do 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 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]","") date, fileData=STRING.readLine(fileData)date=date:gsub("[a-zA-Z]","")
mode, fileData=STRING.readLine(fileData)mode=MODE_UPDATE_MAP[mode] or mode mode, fileData=STRING.readLine(fileData)mode=MODE_UPDATE_MAP[mode] or mode
version,fileData=STRING.readLine(fileData) version,fileData=STRING.readLine(fileData)
player, fileData=STRING.readLine(fileData) if player=="Local Player" then player="Stacker" end player, fileData=STRING.readLine(fileData) if player=="Local Player" then player="Stacker" end
local success
success,fileData=pcall(love.data.decompress,'string','zlib',fileData) success,fileData=pcall(love.data.decompress,'string','zlib',fileData)
if not success then break end if not success then break end
seed, fileData=STRING.readLine(fileData) seed, fileData=STRING.readLine(fileData)
@@ -596,8 +595,7 @@ for _,fileName in next,fs.getDirectoryItems('replay') do
) )
) )
fileName=newName fileName=newName
break until true end
end
local rep=DATA.parseReplay('replay/'..fileName) local rep=DATA.parseReplay('replay/'..fileName)
table.insert(REPLAY,rep) table.insert(REPLAY,rep)
end end

View File

@@ -1282,13 +1282,11 @@ function Player:hold_norm(ifpre)
break break
end end
end end
if success then if success then break end
break
end
end end
if not success then -- All test failed, interrupt with sound if not success then -- All test failed, interrupt with sound
SFX.play('drop_cancel') SFX.play('drop_cancel')
do return end return
end end
self.spinLast=false self.spinLast=false
@@ -1353,13 +1351,11 @@ function Player:hold_swap(ifpre)
break break
end end
end end
if success then if success then break end
break
end
end end
if not success then -- All test failed, interrupt with sound if not success then -- All test failed, interrupt with sound
SFX.play('finesseError') SFX.play('finesseError')
do return end return
end end
self.spinLast=false self.spinLast=false