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/*