mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
[11438] Clarify code for quest start/source/req items adding/remove at quest start.
* Fix problem with complete quest when quest start item == quest source item. And source item not have max items amount setting. * Avoid remove start item for case when it will re-added at next code line as source item
This commit is contained in:
parent
1cd48649c2
commit
a5fe00d6f6
4 changed files with 37 additions and 33 deletions
|
|
@ -196,25 +196,8 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode( WorldPacket & recv_data )
|
|||
break;
|
||||
case TYPEID_ITEM:
|
||||
case TYPEID_CONTAINER:
|
||||
{
|
||||
sScriptMgr.OnQuestAccept(_player, (Item*)pObject, qInfo);
|
||||
|
||||
// destroy not required for quest finish quest starting item
|
||||
bool destroyItem = true;
|
||||
for(int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
|
||||
{
|
||||
if ((qInfo->ReqItemId[i] == ((Item*)pObject)->GetEntry()) && (((Item*)pObject)->GetProto()->MaxCount > 0))
|
||||
{
|
||||
destroyItem = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(destroyItem)
|
||||
_player->DestroyItem(((Item*)pObject)->GetBagSlot(), ((Item*)pObject)->GetSlot(), true);
|
||||
|
||||
break;
|
||||
}
|
||||
case TYPEID_GAMEOBJECT:
|
||||
sScriptMgr.OnQuestAccept(_player, (GameObject*)pObject, qInfo);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue