From 22ad266b271829a07de3965e09873fe2eefff8f5 Mon Sep 17 00:00:00 2001 From: CWXDEV Date: Fri, 12 Jan 2024 23:47:41 +0000 Subject: [PATCH] why the f*ck we using spaces and not tabs :reee: --- project/src/generators/RepeatableQuestGenerator.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/project/src/generators/RepeatableQuestGenerator.ts b/project/src/generators/RepeatableQuestGenerator.ts index 7322d549..b338476d 100644 --- a/project/src/generators/RepeatableQuestGenerator.ts +++ b/project/src/generators/RepeatableQuestGenerator.ts @@ -562,14 +562,13 @@ export class RepeatableQuestGenerator const randomNumbersUsed = []; for (let i = 0; i < distinctItemsToRetrieveCount; i++) { - let randomNumber = this.randomUtil.randInt(itemSelection.length); + let randomNumber = this.randomUtil.randInt(itemSelection.length); + while (randomNumbersUsed.includes(randomNumber) && randomNumbersUsed.length !== itemSelection.length) + { + randomNumber = this.randomUtil.randInt(itemSelection.length); + } - while (randomNumbersUsed.includes(randomNumber) && randomNumbersUsed.length !== itemSelection.length) - { - randomNumber = this.randomUtil.randInt(itemSelection.length); - } - - randomNumbersUsed.push(randomNumber); + randomNumbersUsed.push(randomNumber); const itemSelected = itemSelection[randomNumber]; const itemUnitPrice = this.itemHelper.getItemPrice(itemSelected[0]);