Jump to content

[FIX] Destroy quest item


Guest Most_Mangos

Recommended Posts

What bug does the patch fix? What features does the patch add?

Destroy quest item after handing over of quest`s

For which repository revision was the patch created?

10136

Is there a thread in the bug report section or at lighthouse?

none

Who has been writing this fix? Please include either forum user names or email addresses.

Valhalla-Project

diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 9e0ce9d..4773c03 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -13770,6 +13773,17 @@ void Player::RewardQuest( Quest const *pQuest, uint32 reward, Object* questGiver
            DestroyItemCount( pQuest->ReqItemId[i], pQuest->ReqItemCount[i], true);
    }

+    //Destroy quest item
+    uint32 srcitem = pQuest->GetSrcItemId();
+    if( srcitem > 0 )
+    {
+        uint32 count = pQuest->GetSrcItemCount();
+        if( count <= 0 )
+            count = 1;
+
+        DestroyItemCount(srcitem, count, true, true);
+    }
+
    RemoveTimedQuest(quest_id);

    if (BattleGround* bg = GetBattleGround())

Link to comment
Share on other sites

uint32 count = pQuest->GetSrcItemCount();

if( count <= 0 )

if count is unsigned how it can be less than 0?

anyway I confirm that often questitems are no more removed after quest complete

edit:

same odd check present in Player::GiveQuestSourceItem, I think it's useless anyway since there's check already on load from DB

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use