[Medium] [Bug] Off-hand slot not visually blocked when 2-handed weapon is equipped #341

Closed
opened 2026-06-09 12:53:08 +02:00 by Anexim · 2 comments
Owner

Bug: Off-hand slot not visually blocked when 2-handed weapon is equipped

Steps to reproduce

  1. Open the game
  2. Go to Equipment tab
  3. Verify Basic Staff (2-handed) is equipped in Main Hand
  4. Look at the Off Hand slot

Expected

The Off Hand slot should be visually blocked/greyed out with an indication that it's unavailable due to the 2-handed weapon.

Actual

The Off Hand slot shows "Empty" without any visual indication that it's blocked. Users can interact with it normally, which is misleading since a 2-handed weapon should prevent off-hand equipment.

Root cause

The EquipmentSlotGrid component does not check the twoHanded property of the equipped main hand item when rendering the off-hand slot. It should display a disabled/greyed-out state when a 2-handed weapon is in the main hand.

Store

useCraftingStore (equipment instances) → EquipmentSlotGrid.tsx (rendering)

## Bug: Off-hand slot not visually blocked when 2-handed weapon is equipped ### Steps to reproduce 1. Open the game 2. Go to Equipment tab 3. Verify Basic Staff (2-handed) is equipped in Main Hand 4. Look at the Off Hand slot ### Expected The Off Hand slot should be visually blocked/greyed out with an indication that it's unavailable due to the 2-handed weapon. ### Actual The Off Hand slot shows "Empty" without any visual indication that it's blocked. Users can interact with it normally, which is misleading since a 2-handed weapon should prevent off-hand equipment. ### Root cause The EquipmentSlotGrid component does not check the `twoHanded` property of the equipped main hand item when rendering the off-hand slot. It should display a disabled/greyed-out state when a 2-handed weapon is in the main hand. ### Store `useCraftingStore` (equipment instances) → `EquipmentSlotGrid.tsx` (rendering)
Anexim added the ai:todo label 2026-06-09 12:53:08 +02:00
n8n-gitea was assigned by Anexim 2026-06-09 12:53:08 +02:00
Anexim added ai:in-progress and removed ai:todo labels 2026-06-09 18:43:13 +02:00
Author
Owner

Starting work. Will investigate the off-hand slot visual blocking when a 2-handed weapon is equipped.

Starting work. Will investigate the off-hand slot visual blocking when a 2-handed weapon is equipped.
Anexim added ai:done and removed ai:in-progress labels 2026-06-09 19:03:09 +02:00
Author
Owner

Fix complete.

Root cause: EquipmentSlotGrid rendered all empty slots identically — the off-hand slot showed as a normal "Empty" dashed-border slot even when a two-handed weapon was equipped in mainHand, giving no visual indication that the slot was blocked.

Changes made:

  • EquipmentSlotGrid.tsx — Added getTwoHandedBlocker() helper that checks if mainHand has a two-handed weapon and returns the weapon name. When blocked, the off-hand slot now renders with a Lock icon, "Blocked: <weapon name>" label, reduced opacity (opacity-60), and muted border — visually distinct from normal "Empty" slots.
  • EquipmentSlotGrid.test.ts — New regression test file (11 tests) verifying all 4 two-handed types (basicStaff, oakStaff, arcanistStaff, battlestaff) are correctly flagged, non-two-handed types remain unblocked, and all two-handed types are in the mainHand slot category.

Files changed: 5 files, 109 insertions, 3 deletions. All 1105 tests pass. Committed and pushed to master.

**Fix complete.** **Root cause:** `EquipmentSlotGrid` rendered all empty slots identically — the off-hand slot showed as a normal "Empty" dashed-border slot even when a two-handed weapon was equipped in mainHand, giving no visual indication that the slot was blocked. **Changes made:** - `EquipmentSlotGrid.tsx` — Added `getTwoHandedBlocker()` helper that checks if `mainHand` has a two-handed weapon and returns the weapon name. When blocked, the off-hand slot now renders with a `Lock` icon, `"Blocked: <weapon name>"` label, reduced opacity (`opacity-60`), and muted border — visually distinct from normal "Empty" slots. - `EquipmentSlotGrid.test.ts` — New regression test file (11 tests) verifying all 4 two-handed types (`basicStaff`, `oakStaff`, `arcanistStaff`, `battlestaff`) are correctly flagged, non-two-handed types remain unblocked, and all two-handed types are in the `mainHand` slot category. **Files changed:** 5 files, 109 insertions, 3 deletions. All 1105 tests pass. Committed and pushed to master.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#341