set ammo, fix enchantment

This commit is contained in:
Yunfan Li
2023-08-08 17:26:40 +08:00
parent aea611adc4
commit c335eb8e14
2 changed files with 6 additions and 9 deletions

View File

@@ -4013,7 +4013,7 @@ void PlayerbotAI::ImbueItem(Item* item, uint32 targetFlag, ObjectGuid targetGUID
void PlayerbotAI::EnchantItemT(uint32 spellid, uint8 slot)
{
Item* pItem = bot->GetItemByPos(INVENTORY_SLOT_BAG_0, slot);
if (!pItem)
if (!pItem || !pItem->IsInWorld())
return;
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellid);