fix(Core/Groups): pass actual loot count to OnPlayerGroupRollRewardItem hook#25312
Open
myfmwei wants to merge 3 commits intoazerothcore:masterfrom
Open
fix(Core/Groups): pass actual loot count to OnPlayerGroupRollRewardItem hook#25312myfmwei wants to merge 3 commits intoazerothcore:masterfrom
myfmwei wants to merge 3 commits intoazerothcore:masterfrom
Conversation
…eward script hook OnPlayerGroupRollRewardItem was passing _item->GetCount() which returns the total stack size after merging into existing inventory, instead of item->count which is the actual number of items looted from the roll. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
OnPlayerGroupRollRewardItemwas passing_item->GetCount()as thecountparameter, which returns the total stack size after merging into the player'sexisting inventory
item->count(LootItem::count) which correctly represents the number of items actually looted from the rollGroup.cppProblem
If a player had 3 of a stackable item in their bag and won 2 more via a group roll, the script hook would receive
count = 5(merged stack total) instead ofcount = 2(items actually awarded). ThePLAYER_EVENT_ON_LOOT_ITEMhook already usedLootItem::countcorrectly — this fix makes the roll reward hookconsistent with it.
Test plan