diff options
| author | historia <[not public]> | 2026-09-18 15:16:44 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-09-18 15:16:44 -0400 |
| commit | 7eab582d8a8ee2af1a6baae7baf0696c7005de2e (patch) | |
| tree | 902bbc8c6e39c9f62f779ca23267714ec420b9f5 /internal/game/act_steal.go | |
| parent | 153acb7f644d755c45533b7c5311e3ffa47e8973 (diff) | |
| download | thehouseoficarus-7eab582d8a8ee2af1a6baae7baf0696c7005de2e.tar.gz | |
fix: harden triggers, economy, casino, world data, and admin/net paths
Diffstat (limited to 'internal/game/act_steal.go')
| -rw-r--r-- | internal/game/act_steal.go | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/internal/game/act_steal.go b/internal/game/act_steal.go index 32889ce..5a7f93e 100644 --- a/internal/game/act_steal.go +++ b/internal/game/act_steal.go @@ -42,7 +42,7 @@ var stallGuardTalk = &behavior.TalkConfig{ }, "jail": { Messages: []string{"Off to the detention cell with you!"}, - Action: &behavior.Step{Teleport: 162}, + Action: &behavior.Step{Teleport: 99999162}, Options: []behavior.TalkOption{{Text: "(You are dragged away)"}}, }, "fight": { @@ -254,11 +254,6 @@ func (g *Game) startSteal(sess *net.Session, p *player.Player, targetType string } } - if p.FirstFreeSlot() == -1 { - sess.WriteLine("Your inventory is too full!") - return - } - sess.WriteLine(fmt.Sprintf("You attempt to steal from the %s...", targetName)) g.broadcastAction(sess, "%s glances around the room.", p.Name) @@ -379,12 +374,6 @@ func (g *Game) advanceSteal(sess *net.Session, p *player.Player) { g.saveCharacter(p) - if p.FirstFreeSlot() == -1 { - sess.WriteLine("Your inventory is full.") - g.cancelAction(p) - return - } - p.Action.WaitLeft = engine.ToTicks(stealSpeed) } else { if targetType == "mob" { @@ -429,14 +418,14 @@ func (g *Game) giveStealLoot(sess *net.Session, p *player.Player, drop *behavior name = lootDef.Name } - freeSlot := p.FirstFreeSlot() - if freeSlot == -1 { + // Stack-aware placement: a stackable steal merges into an existing stack, + // so a full inventory with a matching stack is not a failure. + if !placeCraftOutput(p, drop.ItemID, lootDef, qty) { g.World.AddGroundItem(p.RoomID, drop.ItemID, qty) sess.WriteLine(fmt.Sprintf("You steal %s but your inventory is full. It falls to the ground.", g.itemColorize(sess, lootDef, name))) return } - p.SetInvSlot(freeSlot, &player.InventorySlot{ItemID: drop.ItemID, Quantity: qty}) sess.WriteLine(fmt.Sprintf("You steal %s.", g.itemColorize(sess, lootDef, name))) } |
