Skip to content

Commit

Permalink
closes #470
Browse files Browse the repository at this point in the history
  • Loading branch information
Muttley committed Jun 20, 2024
1 parent 58dbb35 commit b5936fd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# v11.12.1

#### Bugs
- [#470] Scavenging gets stuck in a loop if no valid items to draw

---

# v11.12.0

#### Enhancements
Expand Down
9 changes: 1 addition & 8 deletions system/src/sheets/FalloutScavengingLocationSheet.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,8 @@ export default class FalloutScavengingLocationSheet extends FalloutBaseActorShee

const items = [];

const avoidDuplicates = false;

if (table) {
let itemsToDraw = count;
while (itemsToDraw > 0) {
for (let i = 0; i < count; i++) {
const draw = await table.draw({displayChat: false});
const result = draw.results.find(r => r.type === "pack");

Expand All @@ -146,12 +143,8 @@ export default class FalloutScavengingLocationSheet extends FalloutBaseActorShee
result.documentId,
].join(".");

if (avoidDuplicates && this.drawItemsLut[itemUuid]) continue;

this.drawItemsLut[itemUuid] = true;

itemsToDraw--;

const item = await fromUuid(itemUuid);

if (item) {
Expand Down
2 changes: 1 addition & 1 deletion system/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "fallout",
"title": "Fallout: The Roleplaying Game",
"description": "An unofficial system for playing the Fallout RPG from Modiphius Entertainment Ltd.",
"version": "11.12.0",
"version": "11.12.1",
"compatibility": {
"minimum": "11",
"verified": "12"
Expand Down

0 comments on commit b5936fd

Please sign in to comment.