From 8fe9e3c3fef0049df82281a62afe35dda516dfe2 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Fri, 18 Sep 2026 17:48:26 -0400 Subject: fix: close combat ghost, admin traversal, login throttle, journal double-pay, and quality/economy gaps --- internal/game/cmd_drop.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'internal/game/cmd_drop.go') diff --git a/internal/game/cmd_drop.go b/internal/game/cmd_drop.go index 2e27f91..278a57d 100644 --- a/internal/game/cmd_drop.go +++ b/internal/game/cmd_drop.go @@ -152,12 +152,13 @@ func (g *Game) doDrop(sess *net.Session, input string) { if take > remaining { take = remaining } + quality, maxQuality := slot.Quality, slot.MaxQuality if slot.Quantity > take { slot.Quantity -= take } else { p.SetInvSlot(match.Slot, nil) } - g.World.AddGroundItem(p.RoomID, itemID, take) + g.World.AddGroundItemQ(p.RoomID, itemID, take, quality, maxQuality) remaining -= take } dropped := qty - remaining @@ -179,13 +180,20 @@ func (g *Game) doDrop(sess *net.Session, input string) { if slot == nil || slot.ItemID != itemID || slot.Quantity <= 0 { continue } - take := 1 + // Drop as much of the requested quantity as this slot holds, not + // just one: a non-stackable slot holding several units must honour + // "drop 3 ". + take := slot.Quantity + if take > remaining { + take = remaining + } + quality, maxQuality := slot.Quality, slot.MaxQuality if slot.Quantity > take { slot.Quantity -= take } else { p.SetInvSlot(match.Slot, nil) } - g.World.AddGroundItem(p.RoomID, itemID, take) + g.World.AddGroundItemQ(p.RoomID, itemID, take, quality, maxQuality) remaining -= take } @@ -236,7 +244,7 @@ func (g *Game) handleDropAll(sess *net.Session, input string) { if slot == nil || slot.Quantity <= 0 { continue } - g.World.AddGroundItem(p.RoomID, slot.ItemID, slot.Quantity) + g.World.AddGroundItemQ(p.RoomID, slot.ItemID, slot.Quantity, slot.Quality, slot.MaxQuality) def, _ := g.ItemStore.Load(slot.ItemID) name := slot.ItemID if def != nil { -- cgit v1.2.3