v0.14.41 - Fix gear slot detection: 'gi' was matching inside 'leggings'
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.
This commit is contained in:
parent
641363b5b0
commit
e935e34ae1
5 changed files with 15 additions and 9 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
// CONFIG — default settings
|
||||
// ═══════════════════════════════════════════════════════════════════════
|
||||
|
||||
const VERSION = '0.14.40';
|
||||
const VERSION = '0.14.41';
|
||||
|
||||
const CFG = {
|
||||
// — Battle automation
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue