diff --git a/src/strategy/actions/TalkToQuestGiverAction.cpp b/src/strategy/actions/TalkToQuestGiverAction.cpp index ad87a550..7f791d0d 100644 --- a/src/strategy/actions/TalkToQuestGiverAction.cpp +++ b/src/strategy/actions/TalkToQuestGiverAction.cpp @@ -205,17 +205,18 @@ void TalkToQuestGiverAction::RewardMultipleItem(Quest const* quest, Object* ques } else { - // Try to pick the usable item. If multiple list usable rewards. + // Try to pick the usable item. If multiple, list usable rewards. bestIds = BestRewards(quest); - if (!bestIds.empty()) - { + + if (bestIds.size() > 1) AskToSelectReward(quest, out, true); - } - else + + else if (!bestIds.empty()) { // Pick the first item - ItemTemplate const* item = sObjectMgr->GetItemTemplate(quest->RewardChoiceItemId[*bestIds.begin()]); - bot->RewardQuest(quest, *bestIds.begin(), questGiver, true); + uint32 firstId = *bestIds.begin(); + ItemTemplate const* item = sObjectMgr->GetItemTemplate(quest->RewardChoiceItemId[firstId]); + bot->RewardQuest(quest, firstId, questGiver, true); out << "Rewarded " << ChatHelper::FormatItem(item); }