Skip to content

Commit

Permalink
fix : Overmastery section
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay13Jeong committed Jun 30, 2024
1 parent c08bf90 commit a4ff411
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"package": {
"productName": "GBFR Cheat Detector",
"version": "0.161.1"
"version": "0.161.2"
},
"tauri": {
"allowlist": {
Expand Down
2 changes: 1 addition & 1 deletion src/components/PlayerRowExtension.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 }))
Expand Down
15 changes: 9 additions & 6 deletions src/utils2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
}
Expand Down

0 comments on commit a4ff411

Please sign in to comment.