diff options
| author | historia <[not public]> | 2026-09-18 17:48:26 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-09-18 17:48:26 -0400 |
| commit | 8fe9e3c3fef0049df82281a62afe35dda516dfe2 (patch) | |
| tree | dd269f2c0710f334e19f00a191260ebc46284a90 /internal/game/cmd_drop.go | |
| parent | 194164a77eb4f2479b94c19e6f0e1278ab608781 (diff) | |
| download | thehouseoficarus-8fe9e3c3fef0049df82281a62afe35dda516dfe2.tar.gz | |
fix: close combat ghost, admin traversal, login throttle, journal double-pay, and quality/economy gaps
Diffstat (limited to 'internal/game/cmd_drop.go')
| -rw-r--r-- | internal/game/cmd_drop.go | 16 |
1 files changed, 12 insertions, 4 deletions
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 <item>". + 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 { |
