From 7eab582d8a8ee2af1a6baae7baf0696c7005de2e Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Fri, 18 Sep 2026 15:16:44 -0400 Subject: fix: harden triggers, economy, casino, world data, and admin/net paths --- internal/game/cmd_bank.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'internal/game/cmd_bank.go') diff --git a/internal/game/cmd_bank.go b/internal/game/cmd_bank.go index 468b173..0bfc2a3 100644 --- a/internal/game/cmd_bank.go +++ b/internal/game/cmd_bank.go @@ -236,8 +236,11 @@ func (g *Game) doBankWithdraw(sess *net.Session, input string) { entries = append(entries, entryRef{slot: i, pos: len(entries) + 1, name: itemName, id: bs.ItemID, qty: bs.Quantity}) } - idx, err := parseChoiceIndex(input) - if err == nil && idx > 0 && idx <= len(entries) { + // Only a pure number selects a bank slot by position: parseChoiceIndex + // accepts a leading integer and ignores trailing text, so "withdraw 2 + // chips" would otherwise withdraw display entry #2 instead of the named + // item. + if idx, err := strconv.Atoi(strings.TrimSpace(input)); err == nil && idx > 0 && idx <= len(entries) { e := entries[idx-1] g.withdrawBankItem(sess, p, e.slot) return -- cgit v1.2.3