Skip to content

Commit

Permalink
-Internal: Item queue overflow pt2
Browse files Browse the repository at this point in the history
  • Loading branch information
mostlikely4r committed Sep 5, 2024
1 parent 1aa69c6 commit 583766c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
17 changes: 1 addition & 16 deletions playerbot/strategy/actions/UpdateGearAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ bool UpdateGearAction::Execute(Event& event)
{
// Try to equip and enchant the item
uint16 eDest;
if (CanEquipUnseenItem(slot, eDest, pItemId))
if (RandomPlayerbotMgr::CanEquipUnseenItem(bot, slot, eDest, pItemId) == EQUIP_ERR_OK)
{
Item* pItem = bot->EquipNewItem(eDest, pItemId, true);
if (pItem)
Expand Down Expand Up @@ -197,21 +197,6 @@ uint8 UpdateGearAction::GetMasterItemProgressionLevel(uint8 slot, uint8 avgProgr
}
}

bool UpdateGearAction::CanEquipUnseenItem(uint8 slot, uint16& dest, uint32 itemId)
{
dest = 0;
Item* pItem = RandomPlayerbotMgr::CreateTempItem(itemId, 1, bot);
if (pItem)
{
InventoryResult result = bot->CanEquipItem(slot, dest, pItem, true, false);
pItem->RemoveFromUpdateQueueOf(bot);
delete pItem;
return result == EQUIP_ERR_OK;
}

return false;
}

void UpdateGearAction::EnchantItem(Item* item)
{
if (item)
Expand Down
1 change: 0 additions & 1 deletion playerbot/strategy/actions/UpdateGearAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ namespace ai
uint8 GetMasterAverageProgressionLevel();
uint8 GetMasterItemProgressionLevel(uint8 slot, uint8 avgProgressionLevel);

bool CanEquipUnseenItem(uint8 slot, uint16& dest, uint32 itemId);
void EnchantItem(Item* item);

private:
Expand Down

0 comments on commit 583766c

Please sign in to comment.