aboutsummaryrefslogtreecommitdiff
path: root/internal/game/cmd_drop.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-09-16 17:05:17 -0400
committerhistoria <[not public]>2026-09-16 17:05:17 -0400
commit1dad15698845d370e998f7cc5feb8aece3fab58f (patch)
tree8d58058782de9f422573e1f8efd5d130ce7d1ce9 /internal/game/cmd_drop.go
parenta6cf03a6ae98e4fb675da25046d148e92bcf7206 (diff)
downloadthehouseoficarus-1dad15698845d370e998f7cc5feb8aece3fab58f.tar.gz
refactor: remove dead code, consolidate save/error handling, add lint gate
Diffstat (limited to 'internal/game/cmd_drop.go')
-rw-r--r--internal/game/cmd_drop.go10
1 files changed, 5 insertions, 5 deletions
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 {