From e935e34ae1e46f7636c991b4a2cd351e2c4ee397 Mon Sep 17 00:00:00 2001 From: GaboGG Date: Fri, 31 Jul 2026 10:59:17 -0400 Subject: [PATCH] v0.14.41 - Fix gear slot detection: 'gi' was matching inside 'leggings' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Root cause: gearDetectSlot used substring matching. The Body keyword 'gi' (for gi/jacket) appears inside the word 'leggings' (l-e-g-g-i-n-g-s), so EVERY leggings item was classified as Body: - Legs slot showed '(no data)' — its equipped item was mis-detected - Body slot showed leggings items as top candidates (176 score) Fix: word-boundary regex match (\bgi\b) so 'gi' only matches as a standalone word. Also protects against 'cap' in 'capacity' etc. --- scripts/hv-unified.user.js | 8 +++++--- scripts/latest.user.js | 8 +++++--- src/config.js | 2 +- src/gear-analysis.js | 4 +++- src/header.user.js | 2 +- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/scripts/hv-unified.user.js b/scripts/hv-unified.user.js index d2eda97..82abab6 100644 --- a/scripts/hv-unified.user.js +++ b/scripts/hv-unified.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name HV Unified // @namespace hvunified -// @version 0.14.40 +// @version 0.14.41 // @description HV Unified — battle automation, guidance, and UI enhancements for HentaiVerse // @author GaboGG + Hermes // @match *://*.hentaiverse.org/* @@ -17,7 +17,7 @@ // CONFIG — default settings // ═══════════════════════════════════════════════════════════════════════ -const VERSION = '0.14.40'; +const VERSION = '0.14.41'; const CFG = { // — Battle automation @@ -3777,7 +3777,9 @@ function gearDetectSlot(item) { const name = ((item.name || '') + ' ' + (item.category || '')).toLowerCase(); for (const [slot, kws] of Object.entries(GEAR_SLOT_KEYWORDS)) { for (const kw of kws) { - if (name.includes(kw)) return slot; + // Word-boundary match: prevents 'gi' matching inside 'leggings', + // 'cap' inside 'capacity', etc. + if (new RegExp('\\b' + kw + '\\b').test(name)) return slot; } } return null; diff --git a/scripts/latest.user.js b/scripts/latest.user.js index d2eda97..82abab6 100644 --- a/scripts/latest.user.js +++ b/scripts/latest.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name HV Unified // @namespace hvunified -// @version 0.14.40 +// @version 0.14.41 // @description HV Unified — battle automation, guidance, and UI enhancements for HentaiVerse // @author GaboGG + Hermes // @match *://*.hentaiverse.org/* @@ -17,7 +17,7 @@ // CONFIG — default settings // ═══════════════════════════════════════════════════════════════════════ -const VERSION = '0.14.40'; +const VERSION = '0.14.41'; const CFG = { // — Battle automation @@ -3777,7 +3777,9 @@ function gearDetectSlot(item) { const name = ((item.name || '') + ' ' + (item.category || '')).toLowerCase(); for (const [slot, kws] of Object.entries(GEAR_SLOT_KEYWORDS)) { for (const kw of kws) { - if (name.includes(kw)) return slot; + // Word-boundary match: prevents 'gi' matching inside 'leggings', + // 'cap' inside 'capacity', etc. + if (new RegExp('\\b' + kw + '\\b').test(name)) return slot; } } return null; diff --git a/src/config.js b/src/config.js index 8a91abb..4b45d09 100644 --- a/src/config.js +++ b/src/config.js @@ -2,7 +2,7 @@ // CONFIG — default settings // ═══════════════════════════════════════════════════════════════════════ -const VERSION = '0.14.40'; +const VERSION = '0.14.41'; const CFG = { // — Battle automation diff --git a/src/gear-analysis.js b/src/gear-analysis.js index b4875ec..913f298 100644 --- a/src/gear-analysis.js +++ b/src/gear-analysis.js @@ -69,7 +69,9 @@ function gearDetectSlot(item) { const name = ((item.name || '') + ' ' + (item.category || '')).toLowerCase(); for (const [slot, kws] of Object.entries(GEAR_SLOT_KEYWORDS)) { for (const kw of kws) { - if (name.includes(kw)) return slot; + // Word-boundary match: prevents 'gi' matching inside 'leggings', + // 'cap' inside 'capacity', etc. + if (new RegExp('\\b' + kw + '\\b').test(name)) return slot; } } return null; diff --git a/src/header.user.js b/src/header.user.js index 7e06d3f..c96a0eb 100644 --- a/src/header.user.js +++ b/src/header.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name HV Unified // @namespace hvunified -// @version 0.14.40 +// @version 0.14.41 // @description HV Unified — battle automation, guidance, and UI enhancements for HentaiVerse // @author GaboGG + Hermes // @match *://*.hentaiverse.org/*