mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Fix initself crash
This commit is contained in:
@@ -2060,7 +2060,8 @@ bool PlayerbotFactory::CanEquipUnseenItem(uint8 slot, uint16& dest, uint32 item)
|
||||
|
||||
if (Item* pItem = Item::CreateItem(item, 1, bot, false, 0, true))
|
||||
{
|
||||
InventoryResult result = botAI->CanEquipItem(slot, dest, pItem, true, true);
|
||||
InventoryResult result = botAI ? botAI->CanEquipItem(slot, dest, pItem, true, true)
|
||||
: bot->CanEquipItem(slot, dest, pItem, true, true);
|
||||
pItem->RemoveFromUpdateQueueOf(bot);
|
||||
delete pItem;
|
||||
return result == EQUIP_ERR_OK;
|
||||
@@ -2382,10 +2383,10 @@ void PlayerbotFactory::InitAvailableSpells()
|
||||
{
|
||||
bot->learnSpell(tSpell->learnedSpell[0], false);
|
||||
}
|
||||
else
|
||||
{
|
||||
botAI->CastSpell(tSpell->spell, bot);
|
||||
}
|
||||
// else
|
||||
// {
|
||||
// botAI->CastSpell(tSpell->spell, bot);
|
||||
// }
|
||||
}
|
||||
// LOG_INFO("playerbots", "C: {}, ok: {}", ++learnedCounter, oktest);
|
||||
// if (++learnedCounter > 20)
|
||||
|
||||
Reference in New Issue
Block a user