Repository navigation
feat: mail AoE-looted items when bags are full - #69
Conversation
Add the opt-in AOELoot.MailEnable option (default 0). When it is on and a player takes a row from a loot window the module opened, and the only reason the core would refuse it is a full inventory, the item is mailed by The Postmaster and the row is removed as on a normal pickup. Every other case is left to the core handler. The BoP group-trade window on mailed items mirrors the core's SendRollWonItemViaMail (AzerothCore commit 4f1745483, azerothcore/azerothcore-wotlk#26023). Closes azerothcore#31 Co-authored-by: Andrew <47818697+Nyeriah@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change adds a disabled-by-default mail option for AoE loot. For tracked AoE loot windows, eligible items are mailed when inventory storage fails because the inventory is full. The documentation describes the option and updates the mail notification entry. ChangesAoE loot mail delivery
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Player
participant AOELootServer
participant InventoryStorage
participant MailDelivery
Player->>AOELootServer: Send autostore packet for tracked loot
AOELootServer->>InventoryStorage: Check pickup eligibility and store item
InventoryStorage-->>AOELootServer: Return inventory-full result
AOELootServer->>MailDelivery: Send eligible item stacks
AOELootServer-->>Player: Update loot row and notify of mail delivery
Merge Risk: ⚪ Minimal · up to The opt-in mail feature appears mergeable after normal checks; no actionable issue remains established. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 15 functions across 2 files. (3 skipped: 3 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
did you run the self-review? https://www.azerothcore.org/wiki/agentic-self-review |
|
Yes. I attached it directly to the PR, but I can add it separately if you wish. |
Self-review recordSelf-review — featLootMail → masterOutcome 9 findings over 5 rounds — 7 fixed, 2 dismissed — final round clean Reviewed By Claude Code (Claude Agent SDK), Opus 5.5 ( In-game testing solo main path tested by the author on Intent Add an opt-in Diff Metadata Round 1 —
Round 2 — Round 3 — Round 4 —
Round 5 — |
|
perfect, thanks! |
Changes Proposed:
AOELoot.MailEnableoption, off by default. When it's on and a player takes an item from a loot window the module opened, and the only thing stopping the pickup is full bags, the item goes out as a Postmaster "Recovered Item" mail and the row leaves the window just like a normal pickup. Anything else is still handled by the core exactly as before..aoeloot off, or in a group withAOELoot.Group = 0) never mail. Quest items the module auto-collects from nearby corpses aren't mailed either and stay on their corpse. The window is tracked on the player (Player::CustomData) and not in a static map, because the loot pickup packet runs in map threads.HasCarryLimit).OnPlayerLootItem, the same as the core's mail path for roll winners.SendRollWonItemViaMail. The mailed item is created with the player as owner and then taken out of the player's inventory save queue. Otherwise random-suffix items get deleted from the mail on the next character save (CreateMailItems).AOELootWorld::OnAfterConfigLoad)..conf.distand both READMEs.The part worth a close look is
HandleAutostoreLootIteminsrc/aoe_loot.cpp. Its checks mirror the core'sWorldSession::HandleAutostoreLootItemOpcodeandPlayer::StoreLootItem, and any failed check hands the packet back to the core. It only consumes the packet once the item has been mailed.CreateMailItemsandSendMailItemsnext to it handle the mail itself. The rest (aoe_loot.h, theCanPacketReceiveopcode dispatch, config, READMEs) is mechanical.The core's own
SendRollWonItemViaMailhas the same save-queue bug for random-suffix items won in a roll with full bags. That needs a separate core fix.Issues Addressed:
SOURCE:
SendRollWonItemViaMail, added in fix(Core/Groups): preserve BoP trade window when mailing roll-won items azerothcore-wotlk#26023Tests Performed:
How to Test the Changes:
AOELoot.MailEnable = 1and fill your bags..savebefore opening the mailbox, then relog. The mail still has the item with the same suffix.AOELoot.MailEnable = 0: full bags show "Inventory is full" and nothing is mailed.Self-review record
Self-review — featLootMail → master
Outcome 9 findings over 5 rounds — 7 fixed, 2 dismissed — final round clean
Reviewed
b9f71d7(featLootMailvsupstream/masterof azerothcore/mod-aoe-loot, merge-base diff — 5 files, +309 −4)By Claude Code (Claude Agent SDK), Opus 5.5 (
claude-opus-5-5) — self-review v0.13, 2026-09-24In-game testing solo main path tested by the author on
5d074d4: mailing worked, but a random-suffix item logged_SaveInventory ... bag(255) and slot(0) ... incorrectand was deleted from the mail on the next save — fixed inb545f6e/b9f71d7. Author rebuilt worldserver atb9f71d7and re-tested in-game: works as expected.Intent Add an opt-in
AOELoot.MailEnableoption (default 0): when a player takes an item from a creature loot window the module opened and the only obstacle is full bags, the item is mailed and the row removed as on a normal pickup; every other case keeps core behaviour.Diff
8e57fe917b8fe38a6c70f6841ac3019fb793d136Metadata
b31d82e839ed3d926abfca280a67193f7e160f8eRound 1 —
598a938, 5 findingssrc/aoe_loot.cppHandleAutostoreLootItem— carry-limited items held below the limit were mailed on full bags, since mail isn't counted → fixedsrc/aoe_loot.cpprow removal — mailed item skipsUpdateLootAchievements→ dismissed: same as the core's roll-won mail path;OnPlayerLootItemexpects an item in bagsAOE_ITEM_IN_THE_MAILstill labelled "(reserved)" → fixed.editorconfig80 cols — new C++/conf lines too long → fixed; README lines dismissed: tables can't wrap, READMEs already exceed itRound 2 —
ac8a181, round 1 fixes, 2 findings6.
CreateMailItems— repeated template lookup and unreachable null check → fixed7. README conf snippet lines over 80 cols → dismissed (as finding 4)
Round 3 —
5d074d4, round 2 fix, cleanRound 4 —
b545f6e, in-game bug fix (mailed items created without an owner), 2 findingsCreateMailItems— ownerless item saved withowner_guid = 0; deleting the character orphans theitem_instancerow → fixedRound 5 —
b9f71d7, round 4 fixes, cleanSummary by CodeRabbit