From a3604bffe0abc477b18f54b65c0a111b6c268691 Mon Sep 17 00:00:00 2001 From: cyomega <106396564+cyomega@users.noreply.github.com> Date: Wed, 15 May 2024 22:41:25 +0800 Subject: [PATCH] Update equip.js --- equip.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/equip.js b/equip.js index 70c6929..216894f 100644 --- a/equip.js +++ b/equip.js @@ -199,15 +199,10 @@ $(document).ready(function() { function achieveCheck(stat, statMin) { let achieve = 0; let i = stat.length; - while (i--) { - if (statMin[i] == -1) - continue; - achieve += Math.min(stat[i], statMin[i]); - } - if (achieve == goal) - return 1; - else - return achieve / goal; + while (i--) + if (statMin[i] != -1) + achieve += Math.min(stat[i], statMin[i]); + return achieve == goal ? 1 : achieve / goal; } let equip = [[], [], [], [], [], [], [], [], [], [], [], []]; let statMin = []; @@ -270,7 +265,7 @@ $(document).ready(function() { let noCount = true; if (type[i][j][1] > 1) { noCount = false; - for (let k = 0; k < j; k++) { + if (j != 0) for (let k = 0; k < j; k++) { if (type[i][k][1] < 2) continue; if (i != 9) {