From 507ed3f12b5db7cacf5eccb19efbea109bc29b98 Mon Sep 17 00:00:00 2001 From: virusav Date: Sun, 31 Dec 2017 00:34:16 +0100 Subject: [PATCH] Fix CanRewardQuest function 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 --- src/game/Entities/Player.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/game/Entities/Player.cpp b/src/game/Entities/Player.cpp index 786b88dd850..94731257238 100644 --- a/src/game/Entities/Player.cpp +++ b/src/game/Entities/Player.cpp @@ -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) { @@ -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) {