Skip to content

Commit

Permalink
Fix q [quest] command if quest is not a link or for some addons such …
Browse files Browse the repository at this point in the history
…as EQL
  • Loading branch information
ike3 authored and celguar committed Dec 4, 2023
1 parent 028b30a commit f416cdc
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions playerbot/strategy/actions/QueryQuestAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,24 @@ bool QueryQuestAction::Execute(Event& event)

PlayerbotChatHandler ch(bot);
uint32 questId = ch.extractQuestId(text);
if (!questId)
{
for (uint8 slot = 0; slot < MAX_QUEST_LOG_SIZE; ++slot)
{
uint32 logQuest = bot->GetQuestSlotQuestId(slot);

Quest const* quest = sObjectMgr.GetQuestTemplate(logQuest);
if (!quest)
continue;

if (text.find(quest->GetTitle()) != string::npos)
{
questId = quest->GetQuestId();
break;
}
}
}

if (!questId)
return false;

Expand Down

0 comments on commit f416cdc

Please sign in to comment.