From a4ff4112f7de5a550f334160c57c76d6bfb6e691 Mon Sep 17 00:00:00 2001 From: Jay13Jeong <63899204+Jay13Jeong@users.noreply.github.com> Date: Sun, 30 Jun 2024 09:50:34 +0900 Subject: [PATCH] fix : Overmastery section --- package.json | 2 +- src-tauri/tauri.conf.json | 2 +- src/components/PlayerRowExtension.tsx | 2 +- src/utils2.ts | 15 +++++++++------ 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 93ac268..cff1bc0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "gbfr-cheat-detector", "private": true, - "version": "0.161.1", + "version": "0.161.2", "type": "module", "scripts": { "dev": "cargo build --release --package hook --features hook/console && vite", diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 3339588..0a5f720 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -7,7 +7,7 @@ }, "package": { "productName": "GBFR Cheat Detector", - "version": "0.161.1" + "version": "0.161.2" }, "tauri": { "allowlist": { diff --git a/src/components/PlayerRowExtension.tsx b/src/components/PlayerRowExtension.tsx index a220afd..3a42870 100644 --- a/src/components/PlayerRowExtension.tsx +++ b/src/components/PlayerRowExtension.tsx @@ -95,7 +95,7 @@ export const PlayerEquipment = ({ setInvalidSigilIdx(() => checkIdx) } else if (checkStatus === CHEAT_STAT){ setCheatState(() => ( - { status: "Cheat STAT", cheat: true })) + { status: "Cheat Overmasteries", cheat: true })) setInvalidSigilIdx(() => checkIdx) } else { setCheatState(() => ({ status: "Ok", cheat: false })) diff --git a/src/utils2.ts b/src/utils2.ts index aed6e1d..9ff8c5c 100644 --- a/src/utils2.ts +++ b/src/utils2.ts @@ -19,17 +19,20 @@ export const checkCheating = (player: PlayerData) => { const CHEAT_SIGIL: string = "2"; const CHEAT_STAT: string = "3"; const NP: string = "0"; + const emptyOM : number = 2289754288; let status : string = NP; let invalidIdx : string = "-1"; if (player !== undefined && player.overmasteryInfo !== null){ const overmasteries = player.overmasteryInfo.overmasteries; - for (const mastery of overmasteries) { - const checkArrCnt = overmasteries.filter(om => om.id === mastery.id).length; - if (checkArrCnt > 1){ - cheats.push("Duplicate Overmasteries"); - if (status === NP) invalidIdx = "-3"; - if (status === NP) status = CHEAT_STAT; + if (overmasteries[0].id !== emptyOM){ + for (const mastery of overmasteries) { + const checkArrCnt = overmasteries.filter(om => om.id === mastery.id).length; + if (checkArrCnt > 1){ + cheats.push("Duplicate Overmasteries"); + if (status === NP) invalidIdx = "-3"; + if (status === NP) status = CHEAT_STAT; + } } } }