Fix bots not looting non-quest items

This commit is contained in:
郑佩茹
2023-03-23 09:13:13 -06:00
parent e6381476e1
commit 29ecbcddb2

View File

@@ -83,12 +83,9 @@ void LootObject::Refresh(Player* bot, ObjectGuid lootGUID)
bool isQuestItemOnly = false;
GameObjectQuestItemList const* items = sObjectMgr->GetGameObjectQuestItemList(go->GetEntry());
if (!items)
return;
for (int i = 0; i < MAX_GAMEOBJECT_QUEST_ITEMS; i++)
{
if (i >= items->size())
if (!items || i >= items->size())
break;
auto itemId = uint32((*items)[i]);