aboutsummaryrefslogtreecommitdiff
path: root/internal/game/act_farm.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-09-18 01:50:17 -0400
committerhistoria <[not public]>2026-09-18 01:50:17 -0400
commit87d08f0151e643951769e323995f1c5ed89ee200 (patch)
treedc42a0b30ebb5a00dd7ba505cc4eaa44f4f308bc /internal/game/act_farm.go
parent32a3c59cebf2a16277e54d715a67adfdbe00b456 (diff)
downloadthehouseoficarus-87d08f0151e643951769e323995f1c5ed89ee200.tar.gz
fix: harden economy recovery, shutdown concurrency, world validation, and inventory-loss paths
Diffstat (limited to 'internal/game/act_farm.go')
-rw-r--r--internal/game/act_farm.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/game/act_farm.go b/internal/game/act_farm.go
index 91384a0..1e576c3 100644
--- a/internal/game/act_farm.go
+++ b/internal/game/act_farm.go
@@ -180,6 +180,13 @@ func (g *Game) advancePlant(sess *net.Session, p *player.Player) {
seedID := data.SeedID
xp := data.XP
+ if p.CountItem(seedID) < 1 {
+ sess.WriteLine("You no longer have that seed.")
+ p.Action = nil
+ return
+ }
+ p.RemoveItem(seedID, 1)
+
g.ensureFarmState(p, prefix)
g.setPlayerFlag(p, prefix+"_weeds", false)