From ee25d352201b502ff817ea51080a7eb64ead5b97 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Fri, 18 Dec 2020 21:57:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9B=B4=E6=96=B0=E5=90=8E?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=88=A0=E9=99=A4=E8=80=81=E7=89=88=E6=9C=AC?= =?UTF-8?q?rank=E7=9A=84=E4=BB=A3=E7=A0=81=E4=BD=8D=E7=BD=AE=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.lua | 24 ------------------------ parts/scenes/load.lua | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 24 deletions(-) diff --git a/main.lua b/main.lua index 2e1fc6a3..b8f262fc 100644 --- a/main.lua +++ b/main.lua @@ -366,30 +366,6 @@ do end newVersionLaunch=true - --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 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 - S.version=VERSION_CODE FILE.save(RANKS,"conf/unlock","q") FILE.save(STAT,"conf/data") diff --git a/parts/scenes/load.lua b/parts/scenes/load.lua index 006a06a1..0f142460 100644 --- a/parts/scenes/load.lua +++ b/parts/scenes/load.lua @@ -174,6 +174,21 @@ function scene.update() gc.setCanvas() elseif phase==9 then SKIN.change(SETTING.skinSet) + if newVersionLaunch then--Delete old ranks & Unlock modes which should be unlocked + for name,rank in next,RANKS do + local M=MODES[name] + if M and M.unlock and rank>0 then + for _,unlockName in next,M.unlock do + if not RANKS[unlockName]then + RANKS[unlockName]=0 + end + end + end + if not(M and M.score)then + RANKS[name]=nil + end + end + end STAT.run=STAT.run+1 LOADED=true SFX.play("welcome_sfx")