aboutsummaryrefslogtreecommitdiff
path: root/internal/game/cmd_consume.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-09-18 15:16:44 -0400
committerhistoria <[not public]>2026-09-18 15:16:44 -0400
commit7eab582d8a8ee2af1a6baae7baf0696c7005de2e (patch)
tree902bbc8c6e39c9f62f779ca23267714ec420b9f5 /internal/game/cmd_consume.go
parent153acb7f644d755c45533b7c5311e3ffa47e8973 (diff)
downloadthehouseoficarus-7eab582d8a8ee2af1a6baae7baf0696c7005de2e.tar.gz
fix: harden triggers, economy, casino, world data, and admin/net paths
Diffstat (limited to 'internal/game/cmd_consume.go')
-rw-r--r--internal/game/cmd_consume.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/game/cmd_consume.go b/internal/game/cmd_consume.go
index a49d897..2e05620 100644
--- a/internal/game/cmd_consume.go
+++ b/internal/game/cmd_consume.go
@@ -228,8 +228,8 @@ func (g *Game) applyPotion(sess *net.Session, p *player.Player, itemID string, d
case "battery":
batteryRestore := def.PotionBonus
p.Battery += float64(batteryRestore)
- if p.Battery > 100 {
- p.Battery = 100
+ if max := p.MaxBattery(); p.Battery > max {
+ p.Battery = max
}
sess.WriteLine(fmt.Sprintf("You drink the %s. Your battery is restored by %d%%.",
g.itemColorize(sess, def, def.Name), batteryRestore))