aboutsummaryrefslogtreecommitdiff
path: root/internal/game/cmd_get.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-09-16 13:52:58 -0400
committerhistoria <[not public]>2026-09-16 13:52:58 -0400
commitc054b27f628f23fecc505b9e09e78721738f3c4e (patch)
treeea197165bc454ee811dd22b9ceef5dc94bb0b279 /internal/game/cmd_get.go
parentf2d44f10f52d3fe68fdb19b518a330f7af9e1ed2 (diff)
downloadthehouseoficarus-c054b27f628f23fecc505b9e09e78721738f3c4e.tar.gz
fix: shutdown admission, recovery identity/order, rollback journal retention, pickup merge
Diffstat (limited to 'internal/game/cmd_get.go')
-rw-r--r--internal/game/cmd_get.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/internal/game/cmd_get.go b/internal/game/cmd_get.go
index d538afc..515d2ab 100644
--- a/internal/game/cmd_get.go
+++ b/internal/game/cmd_get.go
@@ -68,11 +68,10 @@ func (g *Game) doGet(sess *net.Session, input string) {
qty = available
}
- freeSlot := p.FirstFreeSlot()
- if freeSlot == -1 {
- sess.WriteLine("Your inventory is full.")
- return
- }
+ // No premature free-slot gate here: a stackable pickup may merge into an
+ // existing stack even when every slot is occupied, so capacity is only
+ // required when a new slot is actually needed (matching doGetAll and
+ // doGetAllNamed). See TestPickupMergesIntoFullInventory.
if def != nil && def.Stackable {
for i := 0; i < 28; i++ {
@@ -89,7 +88,7 @@ func (g *Game) doGet(sess *net.Session, input string) {
return
}
}
- freeSlot = p.FirstFreeSlot()
+ freeSlot := p.FirstFreeSlot()
if freeSlot == -1 {
sess.WriteLine("Your inventory is full.")
return