Merge pull request #11310 from Ric101/can_quest_reward

Core/Players: On CanRewardQuest, use the same item dest vector for all potential rewards

Solves issues where the player has enough bag space for each item individually, but not all of them together.

Example to reproduce previous issue:

Obtain Battle of the Crimson Watch (10781)
Make sure you only have 1 slot available in your inventory
Turn in the quest, watch as you don't receive one of the rewards
This commit is contained in:
Duarte Duarte
2014-01-11 16:21:41 -08:00

View File

@@ -15092,11 +15092,11 @@ bool Player::CanRewardQuest(Quest const* quest, uint32 reward, bool msg)
if (!CanRewardQuest(quest, msg))
return false;
ItemPosCountVec dest;
if (quest->GetRewChoiceItemsCount() > 0)
{
if (quest->RewardChoiceItemId[reward])
{
ItemPosCountVec dest;
InventoryResult res = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, quest->RewardChoiceItemId[reward], quest->RewardChoiceItemCount[reward]);
if (res != EQUIP_ERR_OK)
{
@@ -15112,7 +15112,6 @@ bool Player::CanRewardQuest(Quest const* quest, uint32 reward, bool msg)
{
if (quest->RewardItemId[i])
{
ItemPosCountVec dest;
InventoryResult res = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, quest->RewardItemId[i], quest->RewardItemIdCount[i]);
if (res != EQUIP_ERR_OK)
{