尝试清理旧版本不计分模式的rank记录,修复选关界面报错

This commit is contained in:
MrZ626
2020-12-17 17:37:26 +08:00
parent 99611910de
commit 1d293bb186

View File

@@ -369,18 +369,27 @@ do
end
newVersionLaunch=true
--Try unlock modes which should be unlocked
--Try unlock modes which should be unlocked & delete old ranks
for name,rank in next,RANKS do
if rank and rank>0 then
local exist
for _,mode in next,MODES do
if mode.name==name and mode.unlock then
for _,unlockName in next,mode.unlock do
if not RANKS[unlockName]then
RANKS[unlockName]=0
if mode.name==name then
if mode.score then
exist=true
end
if mode.unlock then
for _,unlockName in next,mode.unlock do
if not RANKS[unlockName]then
RANKS[unlockName]=0
end
end
end
end
end
if not exist then
RANKS[name]=nil
end
end
end