aboutsummaryrefslogtreecommitdiff
path: root/internal/game/cmd_shop.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/game/cmd_shop.go')
-rw-r--r--internal/game/cmd_shop.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/game/cmd_shop.go b/internal/game/cmd_shop.go
index e2209fc..282d3ca 100644
--- a/internal/game/cmd_shop.go
+++ b/internal/game/cmd_shop.go
@@ -382,7 +382,7 @@ func (g *Game) doShopSell(sess *net.Session, mob *world.MobInstance, input strin
func (g *Game) shopInvCapacity(p *player.Player, itemID string, def *item.ItemDef) int {
if def != nil && def.Stackable {
quality, maxQuality := stackProps(def)
- for i := 0; i < 28; i++ {
+ for i := 0; i < player.MaxInventorySlots; i++ {
// Capacity must agree with giveShopItems: only a stack with the
// properties a fresh stack gets can absorb a purchase (see
// stackProps). Counting a differently qualified stack here would
@@ -408,7 +408,7 @@ func (g *Game) giveShopItems(p *player.Player, itemID string, qty int, def *item
// harvest, ammo return and pickup: a differently qualified stack is
// not a merge target.
quality, maxQuality := stackProps(def)
- for i := 0; i < 28; i++ {
+ for i := 0; i < player.MaxInventorySlots; i++ {
if slot := p.InvSlot(i); slot != nil && slot.ItemID == itemID && slot.Quality == quality && slot.MaxQuality == maxQuality {
slot.Quantity += qty
return