diff options
| author | historia <[not public]> | 2026-06-19 18:20:26 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-19 18:20:26 -0400 |
| commit | 0ea4eec5dd2122c6704216971eb1249276297867 (patch) | |
| tree | 430fbbef04e837820f1d031c190f52ecd6112e25 /internal/game/cmd_drop.go | |
| parent | 3a58125d14bb307f861b38c6c5b0a63babde7e08 (diff) | |
| download | thehouseoficarus-0ea4eec5dd2122c6704216971eb1249276297867.tar.gz | |
shop fixes, 'toggle' completely removed, movement speed increased
Diffstat (limited to 'internal/game/cmd_drop.go')
| -rw-r--r-- | internal/game/cmd_drop.go | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/internal/game/cmd_drop.go b/internal/game/cmd_drop.go index 1fd99b4..d3141e3 100644 --- a/internal/game/cmd_drop.go +++ b/internal/game/cmd_drop.go @@ -5,12 +5,11 @@ import ( "strings" "thehouseoficarus/internal/net" - "thehouseoficarus/internal/player" ) func (g *Game) doDropAll(sess *net.Session) { - p := sess.Player.(*player.Player) - g.CancelAction(p) + p := sess.Player + g.cancelAction(p) p.ActionState = &ActionState{Type: ActionDropping, TargetName: "inventory"} count := 0 @@ -28,8 +27,8 @@ func (g *Game) doDropAll(sess *net.Session) { } func (g *Game) doDropAllNamed(sess *net.Session, input string) { - p := sess.Player.(*player.Player) - g.CancelAction(p) + p := sess.Player + g.cancelAction(p) matches := g.findInventoryMatches(input, p) if len(matches) == 0 { @@ -86,8 +85,8 @@ func (g *Game) doDropAllNamed(sess *net.Session, input string) { } func (g *Game) doDrop(sess *net.Session, input string) { - p := sess.Player.(*player.Player) - g.CancelAction(p) + p := sess.Player + g.cancelAction(p) qty, itemName := parseQty(input) @@ -182,14 +181,14 @@ func (g *Game) doDrop(sess *net.Session, input string) { } func (g *Game) handleDropAllConfirm(sess *net.Session, input string) { - p, ok := sess.Player.(*player.Player) - if !ok { + p := sess.Player + if p == nil { sess.State = net.StateGame g.writePrompt(sess) return } - g.CancelAction(p) + g.cancelAction(p) input = strings.TrimSpace(strings.ToLower(input)) if input != "y" && input != "yes" { sess.State = net.StateGame |
