Skip to content

Commit

Permalink
Fixed some items having their resource value set to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Chomp committed Jan 15, 2025
1 parent 6e90fb0 commit 40705af
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions project/src/helpers/BotGeneratorHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,12 @@ export class BotGeneratorHelper {
return maxResource;
}

return this.randomUtil.getInt(
// Never let % value fall below 1
const percentOfValue = Math.max(
1,
this.randomUtil.getPercentOfValue(randomizationValues.resourcePercent, maxResource, 0),
maxResource,
);
return this.randomUtil.getInt(percentOfValue, maxResource);
}

/**
Expand Down

0 comments on commit 40705af

Please sign in to comment.