[Medium] [Bug] Design slot 2 bypasses ENCHANT_MASTERY requirement in store action #367
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: Medium
File:
src/lib/game/stores/craftingStore.ts(lines 62-79) vssrc/lib/game/crafting-actions/design-actions.ts(line 69)Description:
In
craftingStore.ts,startDesigningEnchantment()allows starting a design in slot 2 whenever slot 1 is occupied and slot 2 is free (line 68:else if (!state.designProgress2)). However, indesign-actions.ts(line 69), the same function correctly checks forhasEnchantMasterybefore allowing slot 2.The store version has no such check — any player can use two design slots without the mastery special.
Impact: The store's
startDesigningEnchantmentbypasses theENCHANT_MASTERYrequirement, giving all players dual-slot design capability. This is an exploit if the store version is the one wired to the UI.Fix needed: Add the
hasEnchantMasterycheck to the store'sstartDesigningEnchantmentfunction, or remove the duplicate logic and have the store call the design-actions version.Fixed: Added hasEnchantMastery check to craftingStore.startDesigningEnchantment before allowing design slot 2, matching the existing check in design-actions.ts.