fix(Core): Crashfix on loot roll (#12605)
This commit is contained in:
@@ -1449,6 +1449,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap)
|
|||||||
roll->getLoot()->unlootedCount--;
|
roll->getLoot()->unlootedCount--;
|
||||||
AllowedLooterSet looters = item->GetAllowedLooters();
|
AllowedLooterSet looters = item->GetAllowedLooters();
|
||||||
Item* _item = player->StoreNewItem(dest, roll->itemid, true, item->randomPropertyId, looters);
|
Item* _item = player->StoreNewItem(dest, roll->itemid, true, item->randomPropertyId, looters);
|
||||||
|
if (_item)
|
||||||
sScriptMgr->OnGroupRollRewardItem(player, _item, _item->GetCount(), NEED, roll);
|
sScriptMgr->OnGroupRollRewardItem(player, _item, _item->GetCount(), NEED, roll);
|
||||||
player->UpdateLootAchievements(item, roll->getLoot());
|
player->UpdateLootAchievements(item, roll->getLoot());
|
||||||
}
|
}
|
||||||
@@ -1518,6 +1519,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap)
|
|||||||
roll->getLoot()->unlootedCount--;
|
roll->getLoot()->unlootedCount--;
|
||||||
AllowedLooterSet looters = item->GetAllowedLooters();
|
AllowedLooterSet looters = item->GetAllowedLooters();
|
||||||
Item* _item = player->StoreNewItem(dest, roll->itemid, true, item->randomPropertyId, looters);
|
Item* _item = player->StoreNewItem(dest, roll->itemid, true, item->randomPropertyId, looters);
|
||||||
|
if (_item)
|
||||||
sScriptMgr->OnGroupRollRewardItem(player, _item, _item->GetCount(), GREED, roll);
|
sScriptMgr->OnGroupRollRewardItem(player, _item, _item->GetCount(), GREED, roll);
|
||||||
player->UpdateLootAchievements(item, roll->getLoot());
|
player->UpdateLootAchievements(item, roll->getLoot());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user