fix(Core): Crashfix on loot roll (#12605)

This commit is contained in:
Nefertumm
2022-08-01 16:06:45 -03:00
committed by GitHub
parent 639dcec71f
commit 63f52ab751

View File

@@ -1449,7 +1449,8 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap)
roll->getLoot()->unlootedCount--;
AllowedLooterSet looters = item->GetAllowedLooters();
Item* _item = player->StoreNewItem(dest, roll->itemid, true, item->randomPropertyId, looters);
sScriptMgr->OnGroupRollRewardItem(player, _item, _item->GetCount(), NEED, roll);
if (_item)
sScriptMgr->OnGroupRollRewardItem(player, _item, _item->GetCount(), NEED, roll);
player->UpdateLootAchievements(item, roll->getLoot());
}
else
@@ -1518,7 +1519,8 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap)
roll->getLoot()->unlootedCount--;
AllowedLooterSet looters = item->GetAllowedLooters();
Item* _item = player->StoreNewItem(dest, roll->itemid, true, item->randomPropertyId, looters);
sScriptMgr->OnGroupRollRewardItem(player, _item, _item->GetCount(), GREED, roll);
if (_item)
sScriptMgr->OnGroupRollRewardItem(player, _item, _item->GetCount(), GREED, roll);
player->UpdateLootAchievements(item, roll->getLoot());
}
else