From a20fc4d9d11ba600d795e8bacd5e0e0cf63eb2ba Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Tue, 23 Mar 2021 23:41:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=9A=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E5=B0=B1=E7=94=A8=E7=AE=80=E6=B4=81=E6=A8=A1=E5=BC=8F=E7=8E=A9?= =?UTF-8?q?=E4=BC=9A=E6=8A=A5=E9=94=99=EF=BC=88=E4=BF=AE=E6=94=B9=E6=88=90?= =?UTF-8?q?=E7=BB=A9=E6=AF=94=E8=BE=83=E9=80=BB=E8=BE=91=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/player/player.lua | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/parts/player/player.lua b/parts/player/player.lua index a002b6a0..4ca7730e 100644 --- a/parts/player/player.lua +++ b/parts/player/player.lua @@ -1610,26 +1610,27 @@ local function gameOver()--Save record GAME.rank=R end if scoreValid()and M.score then - local r=RANKS[M.name]--Old rank - local needSave - if R>r then - RANKS[M.name]=R - needSave=true - end - if R>0 then - if M.unlock then - for i=1,#M.unlock do - local m=M.unlock[i] - local n=MODES[m].name - if not RANKS[n]then - RANKS[n]=MODES[m].getRank and 0 or 6 - needSave=true + if RANKS[M.name]then--Old rank exist + local needSave + if R>RANKS[M.name]then + RANKS[M.name]=R + needSave=true + end + if R>0 then + if M.unlock then + for i=1,#M.unlock do + local m=M.unlock[i] + local n=MODES[m].name + if not RANKS[n]then + RANKS[n]=MODES[m].getRank and 0 or 6 + needSave=true + end end end end - end - if needSave then - FILE.save(RANKS,"conf/unlock","q") + if needSave then + FILE.save(RANKS,"conf/unlock","q") + end end local D=M.score(P) local L=M.records