This commit is contained in:
Bram verhulst
2025-06-02 21:29:29 +02:00
parent 1104b12ba8
commit f9a11385fe
17 changed files with 3338 additions and 274 deletions

View File

@@ -23,7 +23,7 @@ bool Thinker::IsInvNotFull() const {
bool Thinker::IsItemInInv(const eItemType& itemType) {
return std::any_of(std::begin(m_ItemMemory), std::end(m_ItemMemory),
[itemType](const ItemMemory& memory)->bool { return memory.ItemInfo.Type == itemType; });
[itemType](const ItemMemory& memory)->bool { return memory.ItemInfo.Type == itemType && memory.ItemInfo.Value > 0; });
}
bool Thinker::EmptyValue() {
@@ -31,6 +31,7 @@ bool Thinker::EmptyValue() {
[](const ItemMemory& memory)->bool { return memory.ItemInfo.Value <= 0; });
}
int Thinker::FindEmptyValue(const ItemInfo& item) {
const auto foundItem = std::find_if(std::begin(m_ItemMemory), std::end(m_ItemMemory),
[item](const ItemMemory& memory)->bool { return memory.ItemInfo.Type == item.Type; });