make sure the counts in foraging aren't enritely irrelevant

This commit is contained in:
Jill 2023-11-15 19:03:26 +03:00
parent cb503e3cf9
commit 9af3499d3d
Signed by: oat
GPG Key ID: 33489AA58A955108
1 changed files with 6 additions and 1 deletions

View File

@ -35,7 +35,12 @@ export const craftingStations: CraftingStation[] = [
const rolled = pickRandom(outputs);
const r = res.find(r => r.item.id === rolled.item.id);
if (r) {
r.quantity = r.quantity + 1;
if (r.quantity === rolled.quantity) {
// don't roll more than can be rolled
i--;
} else {
r.quantity = r.quantity + 1;
}
} else {
res.push({ item: rolled.item, quantity: 1 });
}