From 6b5a90b05ed816223317cfbe7c763fb8ca2419a5 Mon Sep 17 00:00:00 2001 From: duel0213 Date: Wed, 22 Jan 2025 01:14:06 +0900 Subject: [PATCH] IIDX: Fixed grade achieve and miss count --- iidx@asphyxia/handlers/grade.ts | 13 ++++++++----- iidx@asphyxia/handlers/music.ts | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/iidx@asphyxia/handlers/grade.ts b/iidx@asphyxia/handlers/grade.ts index 7ec26e1..5266212 100644 --- a/iidx@asphyxia/handlers/grade.ts +++ b/iidx@asphyxia/handlers/grade.ts @@ -120,10 +120,8 @@ export const graderaised: EPR = async (info, data, send) => { if (_.isNil(pcdata)) return send.deny(); if (_.isNil(grade)) { if (cflg == 4) { - if (gtype == 0) - pcdata.sgid = Math.max(gid, pcdata.sgid); - else - pcdata.dgid = Math.max(gid, pcdata.dgid); + if (gtype == 0) pcdata.sgid = Math.max(gid, pcdata.sgid); + else pcdata.dgid = Math.max(gid, pcdata.dgid); updatePcdata = true; } @@ -137,7 +135,12 @@ export const graderaised: EPR = async (info, data, send) => { updateGrade = true; } - if (cflg == 4) updatePcdata = true; + if (cflg == 4) { + if (gtype == 0) pcdata.sgid = Math.max(gid, pcdata.sgid); + else pcdata.dgid = Math.max(gid, pcdata.dgid); + + updatePcdata = true; + } } if (updatePcdata) { diff --git a/iidx@asphyxia/handlers/music.ts b/iidx@asphyxia/handlers/music.ts index be7aaf5..03171f0 100644 --- a/iidx@asphyxia/handlers/music.ts +++ b/iidx@asphyxia/handlers/music.ts @@ -541,7 +541,7 @@ export const musicreg: EPR = async (info, data, send) => { if (version >= 27) ghost_gauge = music_data[clid + 10]; } - mArray[clid] = mArray[clid] == -1 ? mnum : Math.min(mArray[clid], mnum); + if (mnum != -1) mArray[clid] = mArray[clid] == -1 ? mnum : Math.min(mArray[clid], mnum); cArray[clid] = Math.max(cArray[clid], cflg); }