[Bots] Change HasBotItem(item_id) to return slot_id instead of bool. (#2966)

This commit is contained in:
Aeadoin
2023-02-19 16:13:28 -05:00
committed by GitHub
parent 443abf9199
commit c13f9f80d9
6 changed files with 11 additions and 15 deletions
+4 -8
View File
@@ -4478,23 +4478,19 @@ uint32 Bot::CountBotItem(uint32 item_id) {
return item_count;
}
bool Bot::HasBotItem(uint32 item_id) {
bool has_item = false;
EQ::ItemInstance *inst = nullptr;
int16 Bot::HasBotItem(uint32 item_id) {
EQ::ItemInstance const *inst = nullptr;
for (uint16 slot_id = EQ::invslot::EQUIPMENT_BEGIN; slot_id <= EQ::invslot::EQUIPMENT_END; ++slot_id) {
inst = GetBotItem(slot_id);
if (!inst || !inst->GetItem()) {
continue;
}
if (inst->GetID() == item_id) {
has_item = true;
break;
return slot_id;
}
}
return has_item;
return INVALID_INDEX;
}
void Bot::RemoveBotItem(uint32 item_id) {