Skip to content

Commit

Permalink
Fix CanRewardQuest function
Browse files Browse the repository at this point in the history
This will fix the bug when the player will be able to complete a quest
which rewards both a choice and a no-choice item, even if the player
only has one free bag slot available.

Close cmangos/issues#1296

Signed-off-by: Xfurry <xfurry.cmangos@outlook.com>
  • Loading branch information
virusav authored and xfurry committed Dec 30, 2017
1 parent 6490f4c commit 507ed3f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/game/Entities/Player.cpp
Expand Up @@ -13693,11 +13693,11 @@ bool Player::CanRewardQuest(Quest const* pQuest, uint32 reward, bool msg) const
if (!CanRewardQuest(pQuest, msg))
return false;

ItemPosCountVec dest;
if (pQuest->GetRewChoiceItemsCount() > 0)
{
if (pQuest->RewChoiceItemId[reward])
{
ItemPosCountVec dest;
InventoryResult res = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, pQuest->RewChoiceItemId[reward], pQuest->RewChoiceItemCount[reward]);
if (res != EQUIP_ERR_OK)
{
Expand All @@ -13713,7 +13713,6 @@ bool Player::CanRewardQuest(Quest const* pQuest, uint32 reward, bool msg) const
{
if (pQuest->RewItemId[i])
{
ItemPosCountVec dest;
InventoryResult res = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, pQuest->RewItemId[i], pQuest->RewItemCount[i]);
if (res != EQUIP_ERR_OK)
{
Expand Down

0 comments on commit 507ed3f

Please sign in to comment.