Init equipment and init available spell speed up

This commit is contained in:
Yunfan Li
2024-09-04 22:50:02 +08:00
parent 406949f6dd
commit 6ba4384184
5 changed files with 150 additions and 64 deletions

View File

@@ -5277,11 +5277,9 @@ InventoryResult PlayerbotAI::CanEquipItem(uint8 slot, uint16& dest, Item* pItem,
if (pItem->IsBindedNotWith(bot))
return EQUIP_ERR_DONT_OWN_THAT_ITEM;
// Yunfan: skip it
// // check count of items (skip for auto move for same player from bank)
// InventoryResult res = bot->CanTakeMoreSimilarItems(pItem);
// if (res != EQUIP_ERR_OK)
// return res;
InventoryResult res = bot->CanTakeMoreSimilarItems(pItem);
if (res != EQUIP_ERR_OK)
return res;
ScalingStatDistributionEntry const* ssd =
pProto->ScalingStatDistribution
@@ -5300,7 +5298,7 @@ InventoryResult PlayerbotAI::CanEquipItem(uint8 slot, uint16& dest, Item* pItem,
if (!bot->CanUseAttackType(bot->GetAttackBySlot(eslot)))
return EQUIP_ERR_NOT_WHILE_DISARMED;
InventoryResult res = bot->CanUseItem(pItem, not_loading);
res = bot->CanUseItem(pItem, not_loading);
if (res != EQUIP_ERR_OK)
return res;