nullptr exception (#1520)

This commit is contained in:
bash
2025-08-10 19:31:10 +02:00
committed by GitHub
parent bcd6f5bc06
commit 3d28a81508

View File

@@ -164,15 +164,16 @@ void PlayerbotFactory::Init()
{ {
continue; continue;
} }
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(gemId);
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(gemId);
if (proto) {
if (proto->ItemLevel < 60) if (proto->ItemLevel < 60)
continue; continue;
if (proto->Flags & ITEM_FLAG_UNIQUE_EQUIPPABLE) if (proto->Flags & ITEM_FLAG_UNIQUE_EQUIPPABLE)
{
continue; continue;
} }
if (sRandomItemMgr->IsTestItem(gemId)) if (sRandomItemMgr->IsTestItem(gemId))
continue; continue;
@@ -180,9 +181,11 @@ void PlayerbotFactory::Init()
{ {
continue; continue;
} }
// LOG_INFO("playerbots", "Add {} to enchantment gems", gemId); // LOG_INFO("playerbots", "Add {} to enchantment gems", gemId);
enchantGemIdCache.push_back(gemId); enchantGemIdCache.push_back(gemId);
} }
LOG_INFO("playerbots", "Loading {} enchantment gems", enchantGemIdCache.size()); LOG_INFO("playerbots", "Loading {} enchantment gems", enchantGemIdCache.size());
} }