aboutsummaryrefslogtreecommitdiff
path: root/internal/game/act_steal.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-10-06 12:57:23 -0400
committerhistoria <[not public]>2026-10-06 12:57:23 -0400
commit9666676766bf21364f4fc4d0d1d336e72f2a91b4 (patch)
tree0cade34091d7602790dc38cd44053f0b74bbadf2 /internal/game/act_steal.go
parent4bc1daaf259e0c19c5fe4a12ec8bc7f6e5a735c1 (diff)
downloadthehouseoficarus-9666676766bf21364f4fc4d0d1d336e72f2a91b4.tar.gz
refactor: split casino.go, dedup helpers, remove audit docs
Diffstat (limited to 'internal/game/act_steal.go')
-rw-r--r--internal/game/act_steal.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/game/act_steal.go b/internal/game/act_steal.go
index 7df400b..50c83ee 100644
--- a/internal/game/act_steal.go
+++ b/internal/game/act_steal.go
@@ -146,6 +146,12 @@ func (g *Game) resolveStealTarget(p *player.Player, input string) (targetType st
})
if len(matchingMobs) > 0 {
+ // Out-of-range 1-based selectors are no-target, matching findMob. The
+ // previous fallthrough silently stole from the first mob for a single
+ // candidate and reported "nothing here" only for 2+ candidates.
+ if instanceIdx >= 0 && instanceIdx >= len(matchingMobs) {
+ return "", nil, nil, "There's nothing here to steal from."
+ }
uniqueDefs := make(map[string]bool)
for _, m := range matchingMobs {
uniqueDefs[m.DefID] = true