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/correct_audit_fixes_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'internal/game/correct_audit_fixes_test.go') diff --git a/internal/game/correct_audit_fixes_test.go b/internal/game/correct_audit_fixes_test.go index 90fdc53..681843c 100644 --- a/internal/game/correct_audit_fixes_test.go +++ b/internal/game/correct_audit_fixes_test.go @@ -6,6 +6,7 @@ import ( "thehouseoficarus/internal/behavior" "thehouseoficarus/internal/casino" "thehouseoficarus/internal/item" + "thehouseoficarus/internal/net" "thehouseoficarus/internal/prediction" ) @@ -87,6 +88,22 @@ func TestGlobalCommandPreservesArgumentCase(t *testing.T) { } } +// Regression: `get 5 credits` used to sweep the whole purse headroom. +func TestPickupCreditsHonorsRequestedQuantity(t *testing.T) { + h := newHarness(t) + h.seedAccount("alice") + p := h.seedCharacter("alice", "alice") + h.g.RunOnOwner(func() { + p.Credits = 0 + h.g.World.AddGroundItem(p.RoomID, "credits", 10) + sess := &net.Session{Player: p, Conn: newChanConn()} + h.g.pickupCredits(sess, p, "credits", 5) + if p.Credits != 5 { + t.Errorf("credits = %d, want 5 (output: %s)", p.Credits, sess.Conn.(*chanConn).Bytes()) + } + }) +} + // Regression: the player-file classifier must canonicalize repeated "/" and // "data/" prefixes so a raw-editor path cannot dodge the online check. func TestPlayerDataFileNameCanonicalizesPrefixes(t *testing.T) { -- cgit v1.2.3