From eef5ddaa94f8cff6010d092c30fed53d2be01524 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Wed, 17 Jun 2026 17:34:40 -0400 Subject: feat: began implementing smithing, ground item display fixes. --- internal/player/player.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'internal/player/player.go') diff --git a/internal/player/player.go b/internal/player/player.go index 48c9359..e7d98ac 100644 --- a/internal/player/player.go +++ b/internal/player/player.go @@ -338,6 +338,16 @@ func (p *Player) HasItem(itemID string) bool { return false } +func (p *Player) CountItem(itemID string) int { + count := 0 + for _, slot := range p.Inventory { + if slot != nil && slot.ItemID == itemID { + count += slot.Quantity + } + } + return count +} + func (p *Player) RemoveItem(itemID string, qty int) bool { remaining := qty for i, slot := range p.Inventory { -- cgit v1.2.3