From 1dad15698845d370e998f7cc5feb8aece3fab58f Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Wed, 16 Sep 2026 17:05:17 -0400 Subject: refactor: remove dead code, consolidate save/error handling, add lint gate --- internal/game/cmd_drop.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'internal/game/cmd_drop.go') diff --git a/internal/game/cmd_drop.go b/internal/game/cmd_drop.go index 674f3da..072f54a 100644 --- a/internal/game/cmd_drop.go +++ b/internal/game/cmd_drop.go @@ -55,7 +55,7 @@ func (g *Game) doDropAllNamed(sess *net.Session, input string) { qty := slot.Quantity p.SetInvSlot(matches[0].Slot, nil) g.World.AddGroundItem(p.RoomID, itemID, qty) - g.AccountStore.SaveCharacter(p) + g.saveCharacter(p) if qty == 1 { sess.WriteLine(fmt.Sprintf("You drop a %s.", coloredName)) } else { @@ -74,7 +74,7 @@ func (g *Game) doDropAllNamed(sess *net.Session, input string) { p.SetInvSlot(match.Slot, nil) g.World.AddGroundItem(p.RoomID, itemID, slot.Quantity) } - g.AccountStore.SaveCharacter(p) + g.saveCharacter(p) if total == 1 { sess.WriteLine(fmt.Sprintf("You drop a %s.", coloredName)) } else { @@ -138,7 +138,7 @@ func (g *Game) doDrop(sess *net.Session, input string) { p.SetInvSlot(matches[0].Slot, nil) } g.World.AddGroundItem(p.RoomID, itemID, qty) - g.AccountStore.SaveCharacter(p) + g.saveCharacter(p) if qty == 1 { sess.WriteLine(fmt.Sprintf("You drop a %s.", g.itemColorize(sess, def, name))) } else { @@ -167,7 +167,7 @@ func (g *Game) doDrop(sess *net.Session, input string) { } dropped := qty - remaining - g.AccountStore.SaveCharacter(p) + g.saveCharacter(p) if dropped == 0 { sess.WriteLine(fmt.Sprintf("You don't have any %s.", g.itemColorize(sess, def, name))) } else if dropped == 1 { @@ -223,7 +223,7 @@ func (g *Game) handleDropAll(sess *net.Session, input string) { p.SetInvSlot(i, nil) } - g.AccountStore.SaveCharacter(p) + g.saveCharacter(p) sess.State = net.StateGame if len(dropped) == 0 { -- cgit v1.2.3