mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
fix(Core/Loot): Fixed processing duplicated loot item within different groups. (#13038)
Fixes #13038
This commit is contained in:
@@ -197,6 +197,7 @@ bool LootItemStorage::LoadStoredLoot(Item* item, Player* player)
|
||||
li.randomPropertyId = it2->randomPropertyId;
|
||||
li.randomSuffix = it2->randomSuffix;
|
||||
li.rollWinnerGUID = ObjectGuid::Empty;
|
||||
li.groupid = 0;
|
||||
|
||||
// Copy the extra loot conditions from the item in the loot template
|
||||
lt->CopyConditions(&li, it2->conditionLootId);
|
||||
|
||||
@@ -71,7 +71,7 @@ struct LootGroupInvalidSelector : public Acore::unary_function<LootStoreItem*, b
|
||||
|
||||
uint8 foundDuplicates = 0;
|
||||
for (std::vector<LootItem>::const_iterator itr = _loot.items.begin(); itr != _loot.items.end(); ++itr)
|
||||
if (itr->itemid == item->itemid)
|
||||
if (itr->itemid == item->itemid && itr->groupid == item->groupid)
|
||||
{
|
||||
++foundDuplicates;
|
||||
if (_proto->InventoryType == 0 && foundDuplicates == 3 && _proto->ItemId != 47242 /*Trophy of the Crusade*/) // Non-equippable items are limited to 3 drops
|
||||
@@ -401,6 +401,7 @@ LootItem::LootItem(LootStoreItem const& li)
|
||||
is_underthreshold = 0;
|
||||
is_counted = 0;
|
||||
rollWinnerGUID = ObjectGuid::Empty;
|
||||
groupid = li.groupid;
|
||||
}
|
||||
|
||||
// Basic checks for player/item compatibility - if false no chance to see the item in the loot
|
||||
|
||||
@@ -168,6 +168,7 @@ struct LootItem
|
||||
bool is_counted : 1;
|
||||
bool needs_quest : 1; // quest drop
|
||||
bool follow_loot_rules : 1;
|
||||
uint8 groupid : 7;
|
||||
|
||||
// Constructor, copies most fields from LootStoreItem, generates random count and random suffixes/properties
|
||||
// Should be called for non-reference LootStoreItem entries only (reference = 0)
|
||||
|
||||
Reference in New Issue
Block a user