feat(Core/Commands): Quest Add (#1673)

Do not allow to take same quest XX times.
This commit is contained in:
Poszer
2019-04-05 19:27:19 +02:00
committed by Nefertumm
parent 9eb52224cd
commit 819ca8e9ea
+6
View File
@@ -65,6 +65,12 @@ public:
return false;
}
if (player->IsActiveQuest(entry))
{
handler->PSendSysMessage("This quest is already active!");
return false;
}
// check item starting quest (it can work incorrectly if added without item in inventory)
ItemTemplateContainer const* itc = sObjectMgr->GetItemTemplateStore();
ItemTemplateContainer::const_iterator result = find_if(itc->begin(), itc->end(), Finder<uint32, ItemTemplate>(entry, &ItemTemplate::StartQuest));