diff --git a/project/src/helpers/BotGeneratorHelper.ts b/project/src/helpers/BotGeneratorHelper.ts index 74afc6f8d..ded684642 100644 --- a/project/src/helpers/BotGeneratorHelper.ts +++ b/project/src/helpers/BotGeneratorHelper.ts @@ -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); } /**