From 516fd29da423432ef6dfded21a984f1d15dcab1a Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Mon, 5 Oct 2026 17:31:50 -0400 Subject: fix: slop casino and economy fixes --- internal/game/cmd_get.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'internal/game/cmd_get.go') diff --git a/internal/game/cmd_get.go b/internal/game/cmd_get.go index a806ffa..d4742a5 100644 --- a/internal/game/cmd_get.go +++ b/internal/game/cmd_get.go @@ -40,7 +40,7 @@ func (g *Game) doGet(sess *net.Session, input string) { itemID := matches[0].ID if itemID == "credits" { - g.pickupCredits(sess, p, itemID) + g.pickupCredits(sess, p, itemID, qty) return } @@ -162,7 +162,7 @@ func (g *Game) doGetAllNamed(sess *net.Session, input string) { itemID := matches[0].ID if itemID == "credits" { - g.pickupCredits(sess, p, itemID) + g.pickupCredits(sess, p, itemID, 0) return } @@ -391,7 +391,7 @@ func (g *Game) doGetAll(sess *net.Session) { } } -func (g *Game) pickupCredits(sess *net.Session, p *player.Player, itemID string) { +func (g *Game) pickupCredits(sess *net.Session, p *player.Player, itemID string, want int) { // The balance cap is a hard limit: credits the purse cannot absorb must // stay on the ground instead of being removed and then clamped away by // grantCredits. Only the headroom below the cap is taken. @@ -400,7 +400,13 @@ func (g *Game) pickupCredits(sess *net.Session, p *player.Player, itemID string) sess.WriteLine(g.colorize(sess, "currency_pickup", "Your purse can't hold any more credits.")) return } - qty := g.World.RemoveAvailableItem(p.RoomID, itemID, room, p.Name) + // Honor an explicit quantity (get 5 credits) instead of always sweeping + // the whole purse headroom. + take := room + if want > 0 && want < take { + take = want + } + qty := g.World.RemoveAvailableItem(p.RoomID, itemID, take, p.Name) if qty <= 0 { return } -- cgit v1.2.3