Skip to content

fix(PlayerMethods): SendListInventory not respecting vendorId override#384

Merged
iThorgrim merged 2 commits into
azerothcore:masterfrom
Aldori15:fix-sendlistinventory-383
May 22, 2026
Merged

fix(PlayerMethods): SendListInventory not respecting vendorId override#384
iThorgrim merged 2 commits into
azerothcore:masterfrom
Aldori15:fix-sendlistinventory-383

Conversation

@Aldori15
Copy link
Copy Markdown

Fixes #383

When calling player:SendListInventory(creature, vendorId) with a creature that doesn't have UNIT_NPC_FLAG_VENDOR set, the core's GetNPCIfCanInteractWith check would return null, causing the vendor window to silently fail even though a valid vendorId was provided.

The fix will temporarily add the flag to the creature if it is missing and a vendorId override is specified. The flag is then removed immediately after, leaving the creature's state unchanged.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes Eluna’s PlayerMethods::SendListInventory behavior when a vendorId override is provided for a creature that is not flagged as a vendor, preventing the vendor window from silently failing due to the core interaction checks.

Changes:

  • Documented the optional vendorId parameter for SendListInventory.
  • When vendorId is provided and the sender is a Creature missing UNIT_NPC_FLAG_VENDOR, temporarily sets the vendor NPC flag before calling WorldSession::SendListInventory, then removes it immediately after.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@iThorgrim iThorgrim merged commit 1cb86c9 into azerothcore:master May 22, 2026
5 checks passed
@Aldori15 Aldori15 deleted the fix-sendlistinventory-383 branch May 22, 2026 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SendListInventory does not override vendorId

3 participants