diff options
| author | historia <[not public]> | 2026-09-18 16:13:49 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-09-18 16:13:49 -0400 |
| commit | 194164a77eb4f2479b94c19e6f0e1278ab608781 (patch) | |
| tree | 53413add8ed6f32a34d1733397e380cc98ef70ef /internal/game/cmd_trigger_utility.go | |
| parent | 67e01aab85607b9e601185c7d62dff576af3bb43 (diff) | |
| download | thehouseoficarus-194164a77eb4f2479b94c19e6f0e1278ab608781.tar.gz | |
fix: more casino, economy, gameplay, security, and world data hardening gaps
Diffstat (limited to 'internal/game/cmd_trigger_utility.go')
| -rw-r--r-- | internal/game/cmd_trigger_utility.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/game/cmd_trigger_utility.go b/internal/game/cmd_trigger_utility.go index f9e3692..75512d1 100644 --- a/internal/game/cmd_trigger_utility.go +++ b/internal/game/cmd_trigger_utility.go @@ -59,6 +59,14 @@ func (g *Game) triggerProcessing(sess *net.Session, p *player.Player, mod *ModDe } } + // Refuse before consuming the item when the balance is at the cap: + // grantCredits clamps, so processing would otherwise destroy the item's + // value entirely. + if creditValue > creditHeadroom(p) { + sess.WriteLine("You can't carry any more credits.") + return + } + if inv.Quantity > 1 { inv.Quantity-- } else { |
