From 5f37dc9b6f6b79da04da70ae0c33ec8d02998587 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Wed, 1 Jul 2026 02:21:42 -0400 Subject: feat: qol improvements to items crud in admin gui --- internal/game/cmd_wear.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'internal/game/cmd_wear.go') diff --git a/internal/game/cmd_wear.go b/internal/game/cmd_wear.go index 64069bc..c52321c 100644 --- a/internal/game/cmd_wear.go +++ b/internal/game/cmd_wear.go @@ -75,7 +75,7 @@ func (g *Game) doWear(sess *net.Session, input string) { } def, err := g.ItemStore.Load(slot.ItemID) - if err != nil || def.EquipSlot == "" { + if err != nil || def.EquipSlot() == "" { sess.WriteLine(fmt.Sprintf("You can't wear %s.", g.itemColorize(sess, def, match.Name))) return } @@ -85,12 +85,12 @@ func (g *Game) doWear(sess *net.Session, input string) { return } - if def.EquipSlot == item.SlotAmmo && def.Stackable { + if def.EquipSlot() == item.SlotAmmo && def.Stackable { g.equipAmmo(sess, p, match.Slot, slot, def, qty) return } - existingItemID, slotOccupied := p.Equipment[def.EquipSlot] + existingItemID, slotOccupied := p.Equipment[def.EquipSlot()] if slotOccupied { freeSlot := p.FirstFreeSlot() @@ -116,11 +116,11 @@ func (g *Game) doWear(sess *net.Session, input string) { p.EquipQuality[slot.ItemID] = slot.Quality } - p.Equipment[def.EquipSlot] = slot.ItemID + p.Equipment[def.EquipSlot()] = slot.ItemID g.AccountStore.SaveCharacter(p) verb := "wear" - if def.WeaponType != "" { + if def.EquipmentType() != "" { verb = "wield" } sess.WriteLine(fmt.Sprintf("You %s %s.", verb, g.itemColorize(sess, def, match.Name))) @@ -193,19 +193,19 @@ func (g *Game) doWearAll(sess *net.Session) { continue } def, err := g.ItemStore.Load(slot.ItemID) - if err != nil || def.EquipSlot == "" { + if err != nil || def.EquipSlot() == "" { continue } if g.checkRequirements(sess, p, def) != "" { continue } - current, exists := bestPerSlot[def.EquipSlot] + current, exists := bestPerSlot[def.EquipSlot()] val := def.Value - if def.EquipSlot == item.SlotAmmo && def.Stackable { + if def.EquipSlot() == item.SlotAmmo && def.Stackable { val = def.Value * slot.Quantity } if !exists || val > current.value { - bestPerSlot[def.EquipSlot] = struct { + bestPerSlot[def.EquipSlot()] = struct { itemID string value int invSlot int -- cgit v1.2.3