clues: fix MultipleOfItemRequirement not working with non-stacking items

This commit is contained in:
Hydrox6
2019-10-26 08:48:05 +01:00
parent 7bb95ef7c7
commit f715c9f48d

View File

@@ -48,11 +48,16 @@ public class MultipleOfItemRequirement implements ItemRequirement
@Override
public boolean fulfilledBy(Item[] items)
{
int quantityFound = 0;
for (Item item : items)
{
if (item.getId() == itemId && item.getQuantity() >= quantity)
if (item.getId() == itemId)
{
return true;
quantityFound += item.getQuantity();
if (quantityFound >= quantity)
{
return true;
}
}
}